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

React 18 requires explicit definition for FC children #55

Open
ntippie opened this issue Sep 12, 2022 · 0 comments
Open

React 18 requires explicit definition for FC children #55

ntippie opened this issue Sep 12, 2022 · 0 comments

Comments

@ntippie
Copy link

ntippie commented Sep 12, 2022

Describe the bug
A typescript issue arises when using the library with React 18 and using the FormContext element with children. FormContext uses React.FC, which was changed in React 18 to require explicit definition of children. Will submit PR shortly.

https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-typescript-definitions

To Reproduce
Steps to reproduce the behavior:

  1. Use React 18, Typescript, and react-hook-form-jsonschema
  2. Attempt any example that uses FormControl element with children
  3. See error about unable to pass children to FormControl

Expected behavior
Pass children elements to FormControl element as in examples

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

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