weui / react-weui

weui for react
https://weui.github.io/react-weui/docs/
2.85k stars 492 forks source link

JSX element class does not support attributes because it does not have a 'props' property #288

Closed kgh0 closed 5 years ago

kgh0 commented 6 years ago
  1. create-react-app demoApp --scripts-version=react-scripts-ts
  2. npm install --save weui@1.1.0 react-weui @types/react-weui
  3. import { Button } from 'react-weui'; import 'weui'; import 'react-weui/build/packages/react-weui.css'; class App extends React.Component { public render() { return ( \<div>\<Button>AAA\<\/Button> \</div> ); }} Error: [ts] JSX element type 'Button' is not a constructor function for JSX elements. Property 'setState' is missing in type 'Button'. [ts] JSX element class does not support attributes because it does not have a 'props' property. any help?? thx -_-
samfrank commented 5 years ago

Did you ever work this out?

kgh0 commented 5 years ago

in Button.d.ts export default class Button extends React.Component<ButtonProps, any>{