Creating a REACT component
Every React app is built out of components You may have one single component in a simple app or a number of components in something more complex. Simple React components can just render a static (hardcoded) HTML markup can be dynamically rendered based on a locally saved JSON data can be nested into each other to create a more complex app layout can be rendered based on a data provided by a parent component The simplest React component just renders a bit of HTML markup Complex React components A more complex React components might have more logic inside of them, but at the end of the day, they are also just rendering a bit of HTML markup on the page. can include advanced logic that defines what the returned HTML will look like can contain its own state can contain lifecycle methods can include custom methods that will be executed when a user clicks on a button for example Stateless components vs Class components Simple (stateless)...

Comments
Post a Comment