Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Redux actions not connected to component props

I have an action configured but it seems like not being added as a props method.

const TIME_UNTIL_REDIRECT = 3000;

const Logout = (props) => {
    console.log(props); 

    useEffect(() => {
        const timer = setTimeout(() => {
            // props.logout();
            props.history.push('/');
        }, TIME_UNTIL_REDIRECT);        
        return () => {
            clearTimeout(timer);
        };
    }, []);
    
    return (
        <div className = {CSSModule.Logout}>
            <div>You have been logged out.</div>
            <div>Redirecting to main page. Please wait...</div>
            <div><LoadingSpinner /></div>
        </div>
    );
};

const mapDispatchToProps = dispatch => ({
    logout: () => dispatch(actions.logout())
});

export default connect(null, mapDispatchToProps)(withRouter(Logout));

The output of the first command, console.log(props) contains only history, match, location (see below).

props

Expected props to also contain the logout function, but actual outcome is props does not contain the logout function.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!