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
{{ message }}
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
There should be a more reliable way to check if a table was returned from createElement than checking the isElement key of the resultant table. This is largely futureproofing - I want to guarantee a way to find out whether these tables actually came from createElement, with no false-positives (some other API sets isElement to true for its own reasons, for example) or possibility of breakage (I don't think Roact provides any guarantees about the structure of createElement's return value).
This is probably best accomplished via a symbol - instead of checking isElement, I could check [Roact.Element] or something similar; createElement would set both [Roact.Element] and isElement (for backwards compatibility, if nothing else) in the table it returns.
The text was updated successfully, but these errors were encountered:
One thing to keep in mind is that using a symbol harms the ability to serialize elements to JSON or send them over Roblox events. I don't know how important that is to do, but I can imagine a world where that could be useful!
There should be a more reliable way to check if a table was returned from
createElement
than checking theisElement
key of the resultant table. This is largely futureproofing - I want to guarantee a way to find out whether these tables actually came fromcreateElement
, with no false-positives (some other API setsisElement
to true for its own reasons, for example) or possibility of breakage (I don't think Roact provides any guarantees about the structure ofcreateElement
's return value).This is probably best accomplished via a symbol - instead of checking
isElement
, I could check[Roact.Element]
or something similar;createElement
would set both[Roact.Element]
andisElement
(for backwards compatibility, if nothing else) in the table it returns.The text was updated successfully, but these errors were encountered: