question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[$1000] Allow Form component to detect children that are Class components

See original GitHub issue

Problem

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.

image (4)

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:open
  • Created 9 months ago
  • Comments:30 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
fedirjhcommented, Dec 19, 2022

WorkspaceNewRoomPage Refactor is done , PR will be ready to review once other screenshots are added

https://user-images.githubusercontent.com/36869046/208528274-1dfa2514-1943-4dc4-90f9-bcbb01baf974.mov

1reaction
puneetlathcommented, Dec 19, 2022

Awesome!

Upwork job is here as well @mollfpr @fedirjh.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found