Is it possible to have generic children for a generic component?
I'm trying to create a type-safe form, with a generic component. I pass a generic type argument to the parent component and I want it's children to derive that generic type. Here's my attempt:
I remember having issues trying to do that in React, I'm not sure if it's possible
Form is a generic component that receives MyForm type parameter and should only accept such children which name props of are keys of MyForm. The above code errors out in few places. I know that traditionally children should be of type JSX.Element but Elements are not callable.I remember having issues trying to do that in React, I'm not sure if it's possible
