Skip to content

Docs: React + TypeScript examples should use import type #13

@mkosei

Description

@mkosei

Hi, thank you for the great documentation.

While reading "Building your first Solid App with LDO & React", I noticed that many code examples import types like this:

import { FunctionComponent } from "react";
import { FormEvent, FunctionComponent } from "react";

In modern TypeScript + React setups (e.g. with verbatimModuleSyntax or importsNotUsedAsValues), this causes warnings or errors, because these are type-only imports.

It would be better to use type-only imports, for example:

import type { FunctionComponent, FormEvent } from "react";

This would make the examples work more smoothly for users using recent TypeScript versions.

If needed, I can help with a PR to update the examples.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions