21
rated 0 times
[
23]
[
2]
/ answers: 1 / hits: 47338
/ 4 Years ago, sat, april 25, 2020, 12:00:00
I am trying to set a style
for a component, but I do not know how to write the correct syntax in React
. My CSS
looks like this:
.cell {
border: 1px solid rgba(0, 0, 0, 0.05);
}
And here is my render()
method:
render() {
let styles = {
...
//border: 1px solid rgba(0, 0, 0, 0.05), <---- Not correct
};
return (
<div className=cell style={styles}></div>
);
}
How do I convert the CSS
syntax into a React/JS
syntax ?
More From » reactjs