es6のclassを使わずに、returnでDOMを返す時のstyleの書き方になります。
const hoge = () => {
const colorStyle = {
color: '#000',
backgroundColor: '#FFF',
padding: '5px',
};
return (
<span style={colorStyle}>fuga</span>
);
};
export default hoge;
More than 5 years have passed since last update.
es6のclassを使わずに、returnでDOMを返す時のstyleの書き方になります。
const hoge = () => {
const colorStyle = {
color: '#000',
backgroundColor: '#FFF',
padding: '5px',
};
return (
<span style={colorStyle}>fuga</span>
);
};
export default hoge;
Register as a new user and use Qiita more conveniently