I am trying to set inline styles in my React application. In this case, for a span:
There some ways to set style for React Components.
https://facebook.github.io/react/docs/context.html
https://github.com/facebookincubator/create-react-app
using className="your-class-name"
using style={css_object}
or style={{color: this.props.color}}
https://jscomplete.com/repl
stylesheet.css
import './styles.css';
/*
.classname-color{
color: "red";
background: "#0f0";
}
*/
const BTN = (props) => {
return (
My name is
I'm {props.age} yeas old!
);
};
const infos = {
name: "xgqfrms",
age: 23
};
ReactDOM.render( , mountNode);
.classname-color{
color: "red";
background: "#0f0";
}
//
const styles = {
color: "red",
background: "#0f0",
fontSize: "32px"
};
const BTN = (props) => {
return (
My name is
I'm {props.age} yeas old!
);
};
const infos = {
name: "xgqfrms",
age: 23
};
ReactDOM.render( , mountNode);
//
const styles = {
color: "red",
background: "#0f0",
fontSize: "32px"
};
const BTN = (props) => {
return (
My name is
I'm {props.age} yeas old!
);
};
const infos = {
name: "xgqfrms",
age: 23
};
ReactDOM.render( , mountNode);