2

I was reading about the react-redux connect method in the docs and I note something that I don't quite understand, connect takes mapStateToProps, mapDispatchToProps,mergeProps and options as arguments, then it performs several equalities checks to avoid unnecessary functions calls but it doesn't say anything about the wrapped component until I read about this function connectAdvance().

What is the flow that connect() takes and how it reaches connectAdvance()?.

Is connectAdvance() taking the results of connect() and the props from the wrappedComponent and returning a new component with the new props?

Thank you in advance!.

1 Answer 1

2

Yes. In React-Redux v4, connect() did the actual work of generating the wrapper component class. In v5, connectAdvanced() does the real work, and connect() is a wrapper that calls connectAdvanced() with default options for behavior.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.