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

[feature request] add name props to State and Value, and maybe some other components. #119

Closed
xialvjun opened this issue Jun 8, 2018 · 2 comments

Comments

@xialvjun
Copy link

xialvjun commented Jun 8, 2018

Current Behavior:

<State>
  {({ state: my_state_name, setState: my_setstate_name }) => null}
</State>

Expected Behavior:

<State name="my_state_name">
  {({ my_state_name, setMy_state_name }) => null}
</State>
@TrySound
Copy link
Collaborator

TrySound commented Jun 8, 2018

State component mirrors react component api. We would like to keep it like this. For all another components we recommend to use namespace.

<Value initial={0}>
  {adder =>
    <button onClick={() => adder.set(value => value + 1)}>Add to {adder.value}</button>
  }
</Value>

@xialvjun
Copy link
Author

xialvjun commented Jun 8, 2018

Yeah。。。

Strange, why I forgot to not extract the obj ?....😅

@xialvjun xialvjun closed this as completed Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants