I have two components and I want to passing data to components from the other components. I'm trying with this code but I'm getting this error:

**Uncaught TypeError: Cannot read properties of undefined (reading 'params')**

And it is sending the data but it is sending empty. How can I solve this?

**front.layout.js**

```
import Profile from '../../Views/profile'

const [user, setUser] = useState({});

 return (
    <>
       <Profile values={user} />
    </>
 )

```

**index.js**

```
import Layout from "../../Components/layouts/front.layout";

const Profile = (props) => {
    const { params } = props.match;
    .
    . 
    .
}

```