You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The polymorphism over render with ReactRender lets you use different return types, but it's fixed for the class, which means you can't return different types on different ticks of render. I should be able to return a String in one render tick, and a ReactElement in another tick. The correct type I think would be:
{ ... render ::forallr. ReactRenderr. ReactThispropsstate=>Eff ... r }
Edit: This is actually wrong, since it means render can't fix the type.
But this higher-ranked type is problematic. I think instead we should just define coercions to ReactElement, since these can actually be used anywhere and not just the root of a render.
I think if we wanted to keep ReactRender, it would be better to actually give it a member, so that it can be overloaded for arbitrary PureScript types.
Where the "native" element types are implemented via unsafeCoerce. We should still fix the type of render to return a ReactElement. Users should then opt in with toElement.
The polymorphism over
render
withReactRender
lets you use different return types, but it's fixed for the class, which means you can't return different types on different ticks of render. I should be able to return aString
in one render tick, and aReactElement
in another tick. The correct type I think would be:Edit: This is actually wrong, since it means render can't fix the type.
But this higher-ranked type is problematic. I think instead we should just define coercions to
ReactElement
, since these can actually be used anywhere and not just the root of a render.The text was updated successfully, but these errors were encountered: