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

Array as state is cast to Object #291

Closed
zaceno opened this issue Jul 11, 2017 · 3 comments
Closed

Array as state is cast to Object #291

zaceno opened this issue Jul 11, 2017 · 3 comments
Labels
docs You read it here first

Comments

@zaceno
Copy link
Contributor

zaceno commented Jul 11, 2017

This example does not work as expected: https://codepen.io/zaceno/pen/RgqOzL

It fails becasue the state is initialized as state: ['X', 'Y'], but then internally transformed into: {'0':'X, '1': 'Y'} (which does not have join, map or other array methods)

I believe this is a bug. Or it should be documented.

@jorgebucaran jorgebucaran added the docs You read it here first label Jul 11, 2017
@jorgebucaran
Copy link
Owner

@zaceno Yes, you are right. Currently the only supported state types are object, string and number. We should write a proper essay on the state property and include this detail here.

@jorgebucaran
Copy link
Owner

Whoops! 😉

@jorgebucaran
Copy link
Owner

@zaceno Added it to #244.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs You read it here first
Projects
None yet
Development

No branches or pull requests

2 participants