Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const App = () => {
- const arr =['blue', 'green', 'red']
- const generateStyle = color => {
- return {
- backgroundColor: color,
- width: 50,
- height: 50
- }
- }
- return arr.map(color => <div style={generateStyle(color)}></div>)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement