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

The excerpt of Context Providers unexpectedly include a value prop even when the providers does not accept it #44

Open
Nouzbe opened this issue Oct 12, 2022 · 0 comments

Comments

@Nouzbe
Copy link
Collaborator

Nouzbe commented Oct 12, 2022

Suppose you export a Context Provider whose value is internal:

const myContext = React.createContext();

export const MyProvider = ({children}) => {
  const myValue = useState(0);

  return (
    <myContext.Provider value={myValue}>
      {children}
    </myContext.Provider>
  )
}

In this case, react-api-provider creates the following excerpt for MyProvider:

<MyProvider value={value}>
  {children}
</MyProvider >

This is unexpected, because MyProvider does not accept a value prop in this case.

See https://github.com/activeviam/activeui/pull/2916#discussion_r993378052

@Nouzbe Nouzbe changed the title The excerpt of Context Providers unexpectedly include a value prop even when the providers dos not accept it The excerpt of Context Providers unexpectedly include a value prop even when the providers does not accept it Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant