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

Don't mutate style object passed onto createClass #11

Closed
chenglou opened this issue May 25, 2014 · 1 comment
Closed

Don't mutate style object passed onto createClass #11

chenglou opened this issue May 25, 2014 · 1 comment

Comments

@chenglou
Copy link
Owner

Currently a className field is added. We shouldn't do that. Except the current API relies on it.
This makes inserting style inline hard. Here's a tentative new API:
createClass(styleObj) returns a new object of the following format:

{
  className: 'bla',
  style: styleObjReferenceWithNoMutation
}

This way, if you decide to do inline style (in React), you can: <div style={styleObj.style} />. It gets trickier with pseudo-selectors though. Good thing I haven't pushed the pseudo-selectors release yet.

@yocontra
Copy link
Contributor

Yeah - I had it return the className but didn't want to break the current API

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