Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

router react how to pass data to class component

//To pass data to the component
<Route exact path = "/" element= {<Page value={4}/>} />
  
//To get the data from inside the component
const value = this.props.value
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #router #react #pass #data #class #component
ADD COMMENT
Topic
Name
2+6 =