Props are observed by default which means they react to changes and trigger re-renders.
<example-component class-name="a-class" required="true"></example-component>
You'll need to define your prop types in the component definition, like so:
required: true, // is this required?
observed: false // turn off observing changes to this prop
The following properties are used to define props:
|yes||This must be one of |
|Set a default value if one is not set|
|Is this prop required when the component is used? If so, set to |
|Set to |
const exampleComponentInstance = document.querySelector('example-component')
exampleComponentInstance.className = 'another-value'
FicusJS provides built-in props that are available on all components.
|String||A value often used to re-render a component|
There are a number of prop types available for use in components. These are defined in the
type property of the prop definition.
Functions can be passed as props. These cannot be passed using HTML attributes as they cannot be converted from strings. Functions can only be passed using instance properties.