node.js 1202 Questions All rights reserved. I can not get the state from react router Link component using useLocation. css 937 Questions How to set the color of the clock (timePicker) with material-ui? firebase 189 Questions Dual EU/US Citizen entered EU on US Passport. CSS : How to make the whole Card component clickable in Material UI using React JS? In this article, we will create a simple text clickable in React.js just like you would create in a normal HTML project. I included it as an example of what I have tried. How to detect if String contains url and make url clickable using javascript react js More Query from same tag Div content should not push down div below Pass argument to reactjs click handler Material UI react missing action table header Pagination - creating a new document How can I bind a text box to a complex object within state in React? Whether a user presses on the card text, or the card image or the button, it should trigger the onClick event which I call on the button. Inside the components folder create a file Cards.js Project Structure: It will look like the following. Update for v3 29 of August 2018. Then if you need to pass some props, or use logic, just pass the function/content in the prop to Card. The React way to add a click and redirect is to use the Link to provided by the react-router- Inside the component import { Link } from 'react-router-dom; class Parent extends React.Component { render () { <div>< Link to= "/home" > Click here to go back to home page</ Link ></div> } } In route file This.Props.History.Push Works but brings me back to Login page? What properties should my fictional HEAT rounds have to punch through heavy armor and ERA? index.js is my main file, it is where my App component is located. Using React how do I toggle the visibility of a nested component from a container component? Update for v3 29 of August 2018. It will create one card as like below: Material-UI card. To learn more, see our tips on writing great answers. So now it creates the cards but it's creating within the button. reactjs antd Putting onClick= { () => console.log ('CLICK')} on the Card component with the latest Ant Design seems to work fine. How to properly make a GET call in React returning an observable (resembling the method in Angular and not using promises)? How can I make a React "If" component that acts like a real "if" in Typescript? As stated on Charles Bamford's response, you'll have to use the useState method. This is the initial value right? The way that you so that is by passing it on your MainCard component, like this: removeCard(index)} /> In your MainCard component you'll have to get it from the props, like this: const MainCard = ({ onRemove }) => { return ( And then you call it on your remove button: