InterviewSolution
| 1. |
What’s The Difference Between An Element And A Component In React? |
|
Answer» Simply put, a React element describes what you WANT to see on the screen. Not so simply put, a React element is an object representation of some UI. A React COMPONENT is a function or a class which optionally accepts input and returns a React element (TYPICALLY VIA JSX which gets transpiled to a createElement invocation). Simply put, a React element describes what you want to see on the screen. Not so simply put, a React element is an object representation of some UI. A React component is a function or a class which optionally accepts input and returns a React element (typically via JSX which gets transpiled to a createElement invocation). |
|