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

Automatically Object.assign when styles receives an Array #3081

Closed
appsforartists opened this issue Feb 6, 2015 · 5 comments
Closed

Automatically Object.assign when styles receives an Array #3081

appsforartists opened this issue Feb 6, 2015 · 5 comments

Comments

@appsforartists
Copy link

In React Native, these two styles are automatically composed:

<Text style={[styles.ratingValue, getStyleFromScore(criticsScore)]}>

Currently, trying a similar technique in React DOM produces this:

<span style="0:[object Object];1:[object Object];">

Following the principles of "Learn Once, Write Everywhere", the style prop should behave similarly across implementations.

@sophiebits
Copy link
Collaborator

See also #2196. (We do want to get to a consistent story for all of these things, but we're obviously not there yet.)

@appsforartists
Copy link
Author

Thanks @spicyj. I thought I searched before posting. Maybe I forgot to remove the is:open filter.

@afilp
Copy link

afilp commented Feb 26, 2016

+1 I am developing in both React Native and React DOM and find the React Native way of merging styles very convenient. It would be great if you could give this a higher priority. Thanks!

@meepeek
Copy link

meepeek commented Jun 26, 2016

Why is it available in react-native and not react ?

@aweary
Copy link
Contributor

aweary commented Jun 25, 2018

An RFC would be appropriate here since this is a feature request that will likely require significant review and discussion. If someone would like to pursue that please do so at https://github.com/reactjs/rfcs

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

No branches or pull requests

6 participants