using props and constructor

 =

class Car extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return <h2>I am a {this.props.model}!</h2>;
  }
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<Car model="Mustang"/>);

=

No comments:

Post a Comment

How to host application on server new way

 copy the htacess from public to root copy the server.php from public to root but rename to index.php htacess <IfModule mod_rewrite.c>...