Update add-inline-style-in-react (#35739)
- Add my solution in the hint.
This commit is contained in:
@ -6,11 +6,17 @@ You can declare a component style passing the object directly as a prop 'style'.
|
|||||||
|
|
||||||
### Spoiler
|
### Spoiler
|
||||||
```jsx
|
```jsx
|
||||||
|
const styles = {
|
||||||
|
color: 'purple',
|
||||||
|
fontSize: 40,
|
||||||
|
border: "2px solid purple",
|
||||||
|
};
|
||||||
|
|
||||||
class Colorful extends React.Component {
|
class Colorful extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
// change code below this line
|
// change code below this line
|
||||||
return (
|
return (
|
||||||
<div style={{color: "yellow", fontSize: 24}}>Style Me!</div>
|
<div style={styles}>Style Me!</div>
|
||||||
);
|
);
|
||||||
// change code above this line
|
// change code above this line
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user