This repository has been archived by the owner on Jul 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
What is a descriptor
Firtina Ozbalikci edited this page Oct 17, 2017
·
14 revisions
A descriptor allows React to create native elements.
An element is an object that is sent to react to be rendered.
For example, for React-DOM, these are all native elements:
<h1 />
<div />
<span />
And these are component elements:
<MyClass />
<SignupForm />
Where
class MyClass extends React.Component{
render() {
return <div>I'm a component!</div>;
}
}
Descriptors tell react how to render native elements.
They can:
- create instances
- set properties
- mount into containers
- append children
ReactThreeRenderer.render(
<object3D position = {new Vector3(1,2,3)} />,
container);
This instructs ReactThreeRenderer
to do these:
- find the
object3D
descriptor - instruct it to:
- create an instance of
object3D
- set its
position
property tonew Vector3(1,2,3)
- mount it into the
container
object.
- create an instance of
[help needed]