Skip to content

Properties not working with TypeScript #16

@nhajratw

Description

@nhajratw

It seems that passing properties doesn't work with Typescript. Does it only work if you're using the PropTypes package?

interface MyProps {
    data: string
}

class App extends React.Component<MyProps, any> {
    render() {
        return (
            <div className="App">
                    <p>
                        - Data: [{this.props.data}]
                    </p>
            </div>
        );
    }
}

export default App;

Metadata

Metadata

Assignees

Labels

acceptedAccepted for developmentbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions