roact
roact copied to clipboard
"host object" error is confusing
I received an error when using a portal: "Expected target to be host object". I had to look through the source code to figure out host object just means instance (in the Roblox renderer, anyway). The error should probably be changed, as I do not believe this term is used anywhere except internally.
We've tried to expand usage of this term in the Roact documentation:
- https://roblox.github.io/roact/guide/components/#host-components
- https://roblox.github.io/roact/advanced/bindings-and-refs/#refs-as-host-properties
I don't think we communicate the meaning of this term particularly well. Though "instances" is the term that Roblox generally uses, it's very vague and collides with many other terms. We also chose 'host object' to match React, which has the additional constraint of running on multiple DOMs.
I'm not sure what the best path forward is.
Instance would the correct term I feel, but it does collide with other terms. Perhaps it can say something like "Expected target to be an instance, such as a Frame"?