How to use this.executeAction("someAction") in function based Component?

275 Views Asked by At

I've a class based component in which I'm calling the redux store through a action.

class App extends Component {
//Calling Constructor & setting State & other things
this.executeAction("someAction");
}

I want to know what would be the alternate for this in functional Component. P.s:- I'm not sure if it is some library.

1

There are 1 best solutions below

0
ecoplaneteer On

You can use useDipatch hook from react-redux

import { useDispatch } from 'react-redux'
function App() {
    //Calling Constructor & setting State & other things
    const dispatch = useDispatch()
    dispatch("someAction")
}