<repo_name>hsevket/React<file_sep>/README.md
# React
ReactProjects
<file_sep>/src/Cube.js
import { useState } from "react";

const colors = ["white", "red", "blue", "green", "yellow", "orange"];

const rand = () => Math.floor(Math.random() * 6);

const Cube = () => {

  const [myColor, setColor] = useState(colors[rand()]);

  return (
    <button
      type="button"
      onClick={() => setColor(colors[rand()])}
      className="cube"
      style={{ backgroundColor: myColor }}
    >
      {" "}
    </button>
  );
};

export default Cube;
<file_sep>/src/App.js
import "./App.css";
import Cube from './Cube'

// const colors = ["white", "red", "blue", "green", "yellow", "orange"];

// const rand = () => Math.floor(Math.random() * 6);

function App() {
  const cubes = [1, 2, 3, 4, 5, 6, 7, 8, 9];

  return (
    <div className="App">
      <div className="container">
        {cubes.map((x) => (
          <Cube key={x} />
        ))}
      </div>
    </div>
  );
}

export default App;
