#How to declare the type of arrow function component on React 15

6 messages · Page 1 of 1 (latest)

gusty sequoia
#

export const HomePage: React.FunctionComponent<t_home_page_props> = (props) => <div>test</div> , I use it but typescript throw the error on the screenshot. Is there anyone know what's wrong with it? Thank you very much !

zenith flint
austere stratus
#

@gusty sequoia you should how the whole component, not just the error

#

especially the imports and the types you set yourself

#

it looks like a namespace issue or something

#

did you use ReactElement anywhere? and if so, make sure it is React.ReactElement and not something else