-
Notifications
You must be signed in to change notification settings - Fork 95
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
how to get styles object into class type component that extends React.component #218
Comments
My component is import React from "react";
import {css, withStyles} from "react-with-styles";
export class InputForm extends React.Component {
constructor() {
super()
}
render() {
return (
<div className={"row"} style={{float:"left", clear:"both"}}>
<form id="nameform">
First name: <input type="text" name="fname"></input>
Last name: <input type="text" name="lname"></input>
</form>
<button {...css(styles.firstLink)} onClick={onClick}>Button</button>
</div>
);
}
}
export default withStyles(({ color }) => ({
firstLink: {
color: color.primary,
},
secondLink: {
color: color.secondary,
},
}))(InputForm); |
Where should I import or get the styles Object to use in my component .Please help me as I do want to change this functional component or forgive me if didnt understand the basics well @lencioni |
It's passed in as a prop by |
Thank you very much ! @ljharb I am trying to implement this article, but unable to find the ThemeProvider from 'react-with-styles' library , can you please help me with this ? @lencioni , Also cant find the registerDefaultTheme method on ThemedStyleSheet, Can we define our own provider to make the theme available in the whole app ? |
That page appears to be outdated. The readme is a better resource for you at this time https://github.com/airbnb/react-with-styles/blob/master/README.md |
My withStyles.js files is 👍
The text was updated successfully, but these errors were encountered: