Advertisement
karlakmkj

React (JSX) - Render a Component's props

Jan 26th, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3.  
  4. class Greeting extends React.Component {
  5.   render() {
  6.     return <h1>Hi there,{this.props.firstName}!</h1>;
  7.   }
  8. }
  9.  
  10. ReactDOM.render(
  11.   <Greeting firstName='Orange' />,
  12.   document.getElementById('app')
  13. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement