Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit built-in context prop if user component props include context #1958

Merged
merged 2 commits into from
Sep 23, 2022

Commits on Sep 23, 2022

  1. Omit built-in context prop if user component props include context

    Connected components allow users to pass in a `ReactReduxContext`
    instance as a prop named `context`. We also do internal checks to
    see if that really _is_ a context instance, in case the user passed
    a real value as `props.context`.
    
    However, the TS types did not reflect this - `props.context` was always
    a `ReactReduxContext` type, and if users did have a component that
    accepted a prop named `context`, this would cause a type clash.
    
    In this case, the types didn't reflect the reality of runtime behavior.
    
    By extracting "the props of the component" and omitting the built-in
    `context` field type if appropriate, this now works.
    markerikson committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    f40d82d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1236861 View commit details
    Browse the repository at this point in the history