Answer the question
In order to leave comments, you need to log in
React: How can I pass data on onClick?
How can I pass data from one component to another component.
Custom.js
const Custom= ( {dialogs, getDialogs} ) => {
const allUserMessageData = dialogs;
return (
<Container>
<AppChatList>
<ul>
{
allUserMessageData.map( (d, i)=> {
const getCurrentUserData = {
position: d.id
};
return (
<li key={i}>
<Link
onClick={()=> (console.log(getCurrentUserData ))}
to={`/messages/chat/${d.chat_token}`}>
<AppMessageUserList dialog={d} />
</Link>
</li>
)
})
}
</ul>
</AppChatList>
</Container>
);
};
export default Custom;
Answer the question
In order to leave comments, you need to log in
Maybe you just need to read https://reacttraining.com/react-router/web/example...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question