adspace


What are pure functional components?

Answer Posted / Amit Nema

Pure functional components (PFCs) are functional components that always return the same output for a given input and do not modify their inputs. This makes PFCs easy to understand, test, and optimize.nnA pure functional component should meet these two criteria:n1) It should be a function that accepts props as its input and returns a React element as its output.n2) It should not modify the state or other global variables, and it should always return the same output for the same props.

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