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

overwriting props will create console warnings #500

Merged
merged 1 commit into from
Apr 17, 2015
Merged

Conversation

grmlin
Copy link
Contributor

@grmlin grmlin commented Apr 2, 2015

Warning: Don't set .props.className of the React component . Instead, specify the correct value when initially creating the > element. The element was created by LoginDialog.

elements should be cloned instead. React.cloneElement was added with React 0.13.
http://facebook.github.io/react/blog/2015/03/03/react-v0.13-rc2.html#react.cloneelement

Fixed a missing var statement, too.

> Warning: Don't set .props.className of the React component <FlatButton />. Instead, specify the correct value when initially creating the > element. The element was created by LoginDialog.

elements should be cloned instead. React.cloneElement was added with React 0.13. 
http://facebook.github.io/react/blog/2015/03/03/react-v0.13-rc2.html#react.cloneelement

Fixed a missing var statement, too.
@jkruder
Copy link
Contributor

jkruder commented Apr 3, 2015

If we go this route we'll need to update the dep to >=0.13.

@mmrtnz There are several similar warnings in the css-in-js branch. I think making the switch to 0.13 and utilizing the cloneElement is a good idea. It also makes the code cleaner.

@grmlin
Copy link
Contributor Author

grmlin commented Apr 3, 2015

You're right, the update would be necessary and generally a good idea, I think.

Anyway, there is also cloneWithProps that works with 0.12. Does not transfer the needed key prop, though.

@jkruder
Copy link
Contributor

jkruder commented Apr 3, 2015

Some folks have expressed concern over a lack of mixin alternative. It's still supported in v0.13 using React.createClass which facebook has said they do not plan on deprecating until the mixin and property 'problems' have been solved.

@grmlin
Copy link
Contributor Author

grmlin commented Apr 10, 2015

To be honest. I love how react works right now. I don't care for ES6 classes while writing my React components, but I think I'm in the minority with this opinion...

@hai-cea
Copy link
Member

hai-cea commented Apr 15, 2015

@grmlin In order to make this change, we'll need to bump the react version dependency in the package.json. I'm not sure if this will created any breaking changes?

@jkruder
Copy link
Contributor

jkruder commented Apr 16, 2015

Just bumped react to 0.13.X and rebuilt the docs. Everything appears to be working OK, no errors popping up in the console or broken components.

mmrtnz added a commit that referenced this pull request Apr 17, 2015
overwriting props will create console warnings. Fixes #547
@mmrtnz mmrtnz merged commit dab5b46 into mui:master Apr 17, 2015
@mmrtnz
Copy link
Contributor

mmrtnz commented Apr 17, 2015

No issues when running on my machine either. Thanks @grmlin!

@grmlin
Copy link
Contributor Author

grmlin commented Apr 24, 2015

Thanks a lot for your work! :)

@zannager zannager added the component: dialog This is the name of the generic UI component, not the React module! label Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dialog This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants