Closed enugentdt closed 6 years ago
@enugentdt I have just tried the typescript example instructions. It's working. I'm not sure you are looking at the right project.
mainly lacking a default for import React from 'react'; on the first line, which needs to be changed to import * as React from 'react';
Apologies, I wasn't entirely clear in my wording. In the AppBar demo code, it needs to have import React from 'react';
changed to work properly on my system (sans the 'any' type errors). In the create-react-app-with-typescript
project, it is correct.
Oh yes, the demos are written in ES2015. They are as simple as possible.
I think that using import * as React from 'react';
will confuse beginner.
Would there be a possibility in updating them so they work with the latest beta, that way newcomers like myself are able to get a test site up and running quickly? I.e. fixing 'any' type errors, as I've had
@enugentdt If you mean writing our demo in TypeScript, the answer is no. While TypeScript popularity is quickly growing, it's still low compared to raw JS.
Expected Behavior
I am trying to use the third AppBar demo on the material-ui-next component demos. Upon insert into my site, it should not error out, as this is a component demo
Current Behavior
Errors occur in multiple locations - mainly lacking a default for
import React from 'react';
on the first line, which needs to be changed toimport * as React from 'react';
. Additionally, on line 33 among others, the following error occurs:(33,21): Parameter 'event' implicitly has an 'any' type.
Steps to Reproduce
create-react-apps-with-typescript
demo from the reponpm install
components/appbar.tsx
<AppBar>
component topages/index.tsx
yarn start
Context
This issue is entirely blocking, as I am unable to begin development on my own sites if the components I should learn from do not work themselves.
Your Environment