Redux Connect Standalone
This is HOC fuction that allows you to use redux when you aren't able to have a single root Provider in your application. Eg: You are migrating a legacy application to React and has a few react components inside this application.
Before using this, you need to configure your redux store and export it, just like below.
;; const store = ;
Then, you can create a file named connect, import the store into it and generate you connect function:
; const connect = ;
Now, you can use this function the same way you would use react-redux's connect function:
import connect from 'path/to/yourConnect';import TodoList from './TodoList'; mapStateToProps mapDispatchToPropsTodoList
License
MIT