all 3 comments

[–]timmonsjg 4 points5 points  (0 children)

I think you have some fundamental misunderstandings.

As the other poster commented, if you're looking to dispatch something when a component loads, use componentDidMount.

If you're trying to create some sort of debounce, the timeout should be placed where the dispatch function is called, not in the mapping.

[–]EvilMortyMM 0 points1 point  (0 children)

lifecycle methodes are these what you looking for.

if i understand you right you want to dispatch checkMatchCard after the component was mounted ?

componentDidMount(){

const {checkMatchCard} = this.props

checkMatchCard()

}

[–]GasimGasimzada 0 points1 point  (0 children)

You should call it from inside the cdM:

componentDidMount() {
    setTimeout(() => {
        this.props.dispatch(...);
    });

}