0

I want to change this anon. function

const Button: React.FunctionComponent = ({ children }: Props) => { })

to function signature

function Button() { }

But how can I insert the type React.FunctionComponent on function version?

1 Answer 1

1

You can write it like this:

interface DummyProps{
property1:string //here instead of property1 you can name it whatever you want to and its type can be anything.For example i have used here string
}

export default ({property1}:DummyProps) => {
return (
       <div>
           {property1}
       </div>
   );
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.