Open mvasin opened 6 years ago
Did you really type npx create-react-app create-react-app my-app --scripts-version=react-scripts-ts
or was that just a typo here in the issue? If not just a typo, you typed create-react-app
twice.
I misspelled it here on GitHub, it should read npx create-react-app my-app --scripts-version=react-scripts-ts
, but that's not connected to the issue.
Hi, the problem is not the component itself that requires 'name', because by specification, 'name' is mandatory. You have to fix your usage of the component Hello instead, and add 'name' property to it.
For example:
<Hello name='Typescript' />
valid
<Hello name='Typescript' enthusiasmLevel={5} />
valid
<Hello />
error
I bootstraped a fresh CRA app with
npx create-react-app create-react-app my-app --scripts-version=react-scripts-ts
, and pasted this code from readme toApp.tsx
:It blows up with
It can be fixed with
name?
in interface, but I'm not sure it's the right kind of a fix, and let's patch it in the readme to avoid frustration.Here's my
package.json
: