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

withStyles removes all component attributes #66

Open
mar29th opened this issue Oct 14, 2016 · 4 comments
Open

withStyles removes all component attributes #66

mar29th opened this issue Oct 14, 2016 · 4 comments

Comments

@mar29th
Copy link

mar29th commented Oct 14, 2016

When I wrap my components with withStyles, the function essentially creates a fresh class, so all previously defined class attributes, such as static method or component functions are gone. The workaround I have so far is to manually add the attributes.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38374870-withstyles-removes-all-component-attributes?utm_campaign=plugin&utm_content=tracker%2F26439769&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F26439769&utm_medium=issues&utm_source=github).
@frenzzy
Copy link
Member

frenzzy commented Oct 14, 2016

You can call child component methods from parent like so: kriasoft/react-starter-kit#909 (comment)
Also withStyles copies all static method to new class in #38 (but not published yet)

@rencar
Copy link

rencar commented Oct 24, 2016

what about non-static values?

I'm trying to create an uncontrolled input, but withStyle makes
[ComponentWithStyle].value undefined

@frenzzy
Copy link
Member

frenzzy commented Oct 24, 2016

The same as in example above, just use this.child.value instead of this.child.method()

@thebigredgeek
Copy link

https://github.com/thebigredgeek/isomorph-style-loader < There is an active fork here with the latest round of changes, including hoist-non-react-statics integration on the decorator

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

4 participants