[$1000] Allow Form component to detect children that are Class components
See original GitHub issueProblem
Our Form component is built to handle nested components and custom components within the form. That functionality is handled here. It seems, however, if the nested component is a Class component that the children of the class component aren’t detected by the Form component. If the nested component is a Functional component, then it seems to work just fine. You can see this example here where I added Form
to the WorkspaceNewRoom page and added two similar test components, one functional and one class based. The functional component is found by the form but the class based one isn’t. Context Slack discussion: here.
Solution
Update this Form functionality so that it is able to find and recognize custom class-based sub-components.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~019572d1017d216d70
- Upwork Job ID: 1602375844148887552
- Last Price Increase: 2022-12-12
Issue Analytics
- State:
- Created 9 months ago
- Comments:30 (19 by maintainers)
Top Results From Across the Web
only allow children of a specific type in a react component
For React 0.14+ and using ES6 classes, the solution will look like: class CardGroup extends Component { render() { return ...
Read more >Composition vs Inheritance - React
React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components.
Read more >React Class Components - W3Schools
Before React 16.8, Class components were the only way to track state and lifecycle on a React component. Function components were considered "state-less"....
Read more >Advanced Usage - React Hook Form
With the Form component injecting react-hook-form 's props into the child component, you can easily create and compose complex forms in your app....
Read more >React children composition patterns with TypeScript - Medium
Let's examine various parts of the implementation: We define our Props , by making children required and defined as a function, which will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
WorkspaceNewRoomPage
Refactor is done , PR will be ready to review once other screenshots are addedhttps://user-images.githubusercontent.com/36869046/208528274-1dfa2514-1943-4dc4-90f9-bcbb01baf974.mov
Awesome!
Upwork job is here as well @mollfpr @fedirjh.