I am using react-router-dom together with react functional components. I am trying to pass data with "history.push", which is not working.
The redirection to another page with "history.push" itself is working great. BUT the problem is: passing data via "state: {...}" to a component causes: "Cannot read property 'state' of undefined" when I try to access it with "props.location.state" within the component.
I have tried different variations of defining the route.
import React from 'react';
import PageList …Run Code Online (Sandbox Code Playgroud)