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
|
||||
```jsx
|
||||
const styles = {
|
||||
color: 'purple',
|
||||
fontSize: 40,
|
||||
border: "2px solid purple",
|
||||
};
|
||||
|
||||
class Colorful extends React.Component {
|
||||
render() {
|
||||
// change code below this line
|
||||
return (
|
||||
<div style={{color: "yellow", fontSize: 24}}>Style Me!</div>
|
||||
<div style={styles}>Style Me!</div>
|
||||
);
|
||||
// change code above this line
|
||||
}
|
||||
|
Reference in New Issue
Block a user