weui / react-weui

weui for react

Home Page:https://weui.github.io/react-weui/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

kgh0 opened this issue · comments

commented
  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 -_-
commented

Did you ever work this out?

commented

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