I have a problem with <Redirect /> from react-router-dom. It does not redirect the user to the given path.
    const getCourse = () => {
            console.log('gg');
            <Redirect to={"/courses/" + id} /> //
        }
...
    <div className="menu__course" onClick={() => getCourse()}>
In console I see 'gg' so function is called but my path doesn't change
 
     
     
    