Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Using Props With React: With Props


function App() {

return(
<>

<Abc/>
<Abc x="xxxxx"/>
    </>
  );
}

export default App;


function Abc(props)
{
return (<>{props.x?<b>ffffff</b>:<i>gggggg</i>}</>)
}
/*Abc depends on the value of the x prop*/
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #Using #Props #With #With #Props
ADD COMMENT
Topic
Name
6+8 =