Skip to content

React stateless functional components #5675

Closed
@Shadowfaxenator

Description

@Shadowfaxenator
let ByComponentIoS = ({ name: string })=> <h1>{name}</h1>

export default class ByComponent extends React.Component<IByComponentProps,{}> { 

    constructor(props: IByComponentProps) {
        super(props);    
    }
    render() {
        return <ByComponentIoS name="test"/>

    }
}

I get error TS2605: JSX element type 'Element' is not a constructor function for JSX elements.Property 'render' is missing in type 'Element'.

How to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions