adspace


What is function based component?

Answer Posted / Prem Varddhan

A functional-style component in React is a component that returns a React element (JSX) instead of using a render method. It is also known as a stateless component.nnHere's an example of a functional component:nn```javascriptnfunction MyComponent(props) {n return <div>Hello {props.name}!</div>n}n```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use events in reactjs? Give an example of using events?

559


How would you create higher order components (hocs) in react.js?

447