We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5203c4 commit 2dcf64fCopy full SHA for 2dcf64f
1 file changed
src/components/Grid/index.js
@@ -1,19 +1,13 @@
1
-import React, { Component } from 'react'
+import React from 'react'
2
import PropTypes from 'prop-types'
3
import './style.css'
4
5
-export default class Grid extends Component {
6
- Circles = () => {
7
- let div = []
8
- for (let index = 0; index < 9; index++) {
9
- div.push(<div key={index} style={{ background: `${this.props.color}` }}></div>)
10
- }
11
- return div;
12
+export default function Grid({ color }) {
+ const circles = [...Array(9)].map((_, index) => (
+ <div key={index} style={{ background: `${color}` }} />
+ ));
13
14
- render() {
15
- return <div className="lds-grid">{this.Circles()}</div>
16
+ return <div className="lds-grid">{circles}</div>;
17
}
18
19
Grid.propTypes = {
0 commit comments