Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default value for a state def as a prop reference #294

Open
alexnm opened this issue Jul 2, 2019 · 0 comments
Open

Set default value for a state def as a prop reference #294

alexnm opened this issue Jul 2, 2019 · 0 comments
Labels
proposal Something up for debate

Comments

@alexnm
Copy link
Contributor

alexnm commented Jul 2, 2019

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.

@alexnm alexnm added the proposal Something up for debate label Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Something up for debate
Projects
None yet
Development

No branches or pull requests

1 participant