Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

pass number as a prop in react

function Child({num}) {
  return (
    <div>
      <h2>the Number is: {num}</h2>
    </div>
  );
}

export default function App() {
  return (
    <div>
      <Child num={42} />
    </div>
  );
}
Source by bobbyhadz.com #
 
PREVIOUS NEXT
Tagged: #pass #number #prop #react
ADD COMMENT
Topic
Name
2+7 =