teleport-code-generators
teleport-code-generators copied to clipboard
Set default value for a state def as a prop reference
This is not necessarily a common case, but it appears in a lot of examples, where you would define a component in React for example:
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
isActive: props.defaultActive
}
}
}
This would require using the UIDLDynamicReference
or UIDLStaticValue
as defaultValue
for a state key inside stateDefinitions
.