I am currently in the process of designing the interface for a game engine that is written in JavaScript and ReactJS.
If a game object has a texture, the source of t
You should be able to just do this.props.texture.props
. I'm not ware of it being an anti-pattern, but I don't think it's a common pattern either. It certainly looks like it may be breaking encapsulation if you want to access a specific prop.
You don't have to pass the element as prop to get a reference to it. You can access children via this.props.children
.
See the documentation for more info.