Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

passing props in react functional components

function Welcome(props) {
  return <h1>Hello, {props.name}</h1>;
}

const root = ReactDOM.createRoot(document.getElementById('root'));
const element = <Welcome name="Sara" />;
root.render(element);
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #passing #props #react #functional #components
ADD COMMENT
Topic
Name
9+9 =