Fourth Parameter for connect()
Learn how to modify the behavior of the connect() function.
We'll cover the following
The options
parameter
If you actually want to use the fourth (options
) parameter of the connect()
method, you should really know what you’re doing. Redux is optimized to only ever really need these options in very rare edge cases. For example, you can define your own context for Redux to use or define functions that compare whether a component needs to be re-rendered or not. This list is a complete summary of the options available:
{
context: Object,
pure: boolean,
areStatesEqual: Function,
areOwnPropsEqual: Function,
areStatePropsEqual: Function,
areMergedPropsEqual: Function,
forwardRef: boolean,
}
If you feel like you might need these options (Spoiler alert: in most cases, the answer is “No, you don’t need these”), you should check out the official documentation.
Get hands-on with 1200+ tech skills courses.