score:1
Accepted answer
define one state
const [show, setshow] = react.usestate(false);
function
const handlepassinfoshow = (data){
setshow(true);
console.log(data);
}
change this to
<listgroup>
{userinfo.map(item =>
(
<>
<listgroup.item key={item.id} onclick={()=>handlepassinfoshow(item)}>
{item.name}</listgroup.item>
</>
)
)}
</listgroup>
{show && ( <modalpassinfo
modelclose={() => handlepassinfoclose()}
modelshow={showpaainfo}
//id={item.id}
setshowpaainfo={setshowpaainfo}
/>
)}
Source: stackoverflow.com
Related Query
- ReactJS sending data to modal from map items
- Sending data from a form to the parent component in ReactJS
- Map and Render Data from API in ReactJS (Function Components)
- How to display a list of items from a reactjs map loop horizontally with wrap?
- ReactJS sending data from Form select via axios.post
- Reactjs Search - Get data from sessionStorage and map through it
- reactjs update setState from map object data
- I want to be able to show the items I pulled from the database by filtering, but I can't pull the data as I want. I am using Reactjs
- Sending data to a php file from reactJS with axios
- How to get data from async request in reactjs and add it to React-bootstrap Modal
- Parse data from JSON in ReactJS
- ReactJS - get json object data from an URL
- ReactJS not fetching data from server when using 'url' attribute
- Sending Data from React to MySQL
- How to Pass input Field Data from Modal to the Container in react-Native?
- Reactjs - getting data from server and updating
- Open modal from other component in ReactJS
- Create nested JSX list items from multi-level nested array of objects reactjs
- How to pass data from one component to another ReactJS
- Sending pdf files to user from nodejs to reactjs
- ReactJS: get data from api and map data
- Sending data from Express to React through a redirect
- How to pass data from one component to another while using API in reactjs
- Getting value from a map data structure
- How can i get array of object from this data for state and count in reactjs
- 404 error while sending data from React to Node?
- Accessing data from rest api with reactjs
- How to populate select dropdown elements with data from API - ReactJS
- How to map inside map function and show the data in Reactjs
- Close modal A after opening modal B from modal A in reactjs with react-bootstrap
More Query from same tag
- How to share a variable between epics that are in different files?
- Filter on a list with headings and keep heading of filtered item(s)
- combineReducers doesn't infer type
- Hide navigation on particular route in React Router V4?
- Warning: `value` prop on `input` should not be null
- React-admin keep form data after create view submit
- Which way do props flow with compose()?
- Sorting not being applied in a list of objects
- Logout error with conditional collection on React Firebase app
- (0 , _helperModuleTransforms.getModuleName) is not a function - React Native
- Momentjs is not converting certain Spanish months to UTC
- Can I declare props type for a functional UI component?
- React-table on click single row highlight. Disable multiple select
- How to pass a web worker instance to another component in react js?
- my countdown clock beings counting down one turn after it should
- SetState not re-rendering and galleries getting mixed
- ReactJS: Accessing child components properties in parent
- How to load react component from an external service inside a React app via AJAX
- Random Blank Space is showing up after putting two divs inside one div and then using justify content
- Set delay for axios get request in useEffect
- React app builds successfully but shows white screen on chrome
- react-router v3: How to load data for the component when the same route with different query params is loaded
- Why scrollWidth returns the same value of offsetWidth even when content overflows?
- I want to loop through an item to create an array then store it in array field in the DB. How do I do it?
- How to declare a type for react thunk in typescript and reuse for component dependency?
- Tailwind background image from api
- Failed prop type: The prop `address` is marked as required in `UpdateAddress`, but its value is `undefined`
- Why Navigate to a route not working in react?
- How can i test with Enzyme+Mocha method call inside Component
- firebase add user information while creating user (react.js)