score:1
you canNot render component onClick of onother component you should set the item that you want to show in state, then pass it to that component using
change this line
<button onClick={<Graph tid={developer.tid}/>}>Data</button>
to
<button
onClick={() => this.setState({
selectedDeveloperId:developer.tid
})}
>
Data
</button>
so now if you click on the button, it will set developer id in state of component
and in render method after closing tag of table put this
{!!selectedDeveloperId && (<Graph tid={selectedDeveloperId}/>)}
so it will render Grap component if you click on a button with id of selected developer
Source: stackoverflow.com
Related Query
- How to pass value from one component to another using onClick in React
- How to pass a prop from one component to another when using react router link
- How can I pass props from one component to another using Link and router in react
- How to pass data from one component to another component in onchange using React js
- How to pass props onClick from one component to another in React JS
- How to pass json data from one component to another using functions in react
- How to pass props from one component to another using optional handling in react hooks
- Pass onClick Value From One Component to Another in React
- How to pass the Like value from one component to another component using reactjs?
- How to pass data from one component to another in React or React-Redux?
- How to pass data from one component to another while using API in reactjs
- React - how to populate one select menu based on a value of another select menu using data from a local .json file
- How to pass id from one component to another component onclick of an element
- How to pass value of a const from one .js file to another in React JS?
- How to assign value onClick from different component to another component in React
- How to pass return value from component to another one
- How to navigate from one component to another by clicking a button using React router
- how to pass the data from one component to another in react js
- How to pass state from one component to another in React js?
- How to transfer data from one parent component to another parent component in react using router / router params
- How to pass method from one component to another without using Arrow Function?
- React - How can I pass API data from one component to another in a different js file?
- How do I pass data from one sibling to another using React Router?
- How to pass array as result from one functional component to another in React
- How can I pass useState value from one component to another component
- React couldn't pass a data from one class component into another using Link
- How to pass a dynamic value from one component to the other in React
- How to pass data from one component to another component/parent in React
- How can i pass data from one component to another using hooks
- How to pass data value from one Child Component to another Child Component in React?
More Query from same tag
- How can I 'bootstrap' support for webpack Module Federation when the webpack output type is "library"?
- Open link in new tab when ctrl + click it in ReactJS?
- How to integrate OpenCV.js in a React WebApp?
- When using Material-UI's tab component, how do I customize the style for a selected tab?
- Why does the initialValue of formik remove when typing on the text input?
- Bugs in Sidebar Menu with React Router V4
- use ES6 .map() on multiple times nested objects for react components
- loop through an object within an array in ractjs
- Code coverage missing even when the lines are hit
- Rollup Error: 'isValidElementType' is not exported by node_modules/react-is/index.js
- Setting 2 classNames through props
- what do I put in className if I am using CSS module with .active property
- Storing current logged in userId in a variable using React SPFx
- Overloads don't match on useRef
- Why do semicolons throw error in react JSX?
- Maintain aspect ratio for stage
- React Ref on File Input Does Not Trigger From Change Event When Cleared
- useEffect re-render the same result from a supabase query
- Conditional className not updated when boolean updated
- How to set active class in react render method?
- How to access child route params in react router
- Warning: Unknown event handler property `onHeaderClick`. It will be ignored
- How to optimize code in repeated conditional rendering?
- First value of array undefined
- How do I make the Toast appear?
- React is taking way more time for execution than expected
- How to set activeClassName for wrapper element of Link or IndexLink in react-router?
- Mocking Redux store when testing React components?
- Prevent addition of a trailing slash to a URL
- Is it possible to query firebase-firestore data by multiple criteria/values