SHARE
TWEET

Untitled

a guest Aug 25th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { useState } from "react";
  2.  
  3. //import any components needed
  4. import NumberButton from './NumberButton'
  5.  
  6. //Import your array data to from the provided data file
  7. import { numbers } from "../../../data"
  8.  
  9. const Numbers = () => {
  10.   // STEP 2 - add the imported data to state
  11.   const [numState, setNumState] = useState(numbers);
  12.  
  13.   return (
  14.     <div>
  15.       {
  16.        numState.map(x => {
  17.           return (
  18.          <NumberButton number={x} />);
  19.        })
  20.       }
  21.     </div>
  22.   );
  23. };
  24.  
  25. export default Numbers;
  26.  
  27.  
  28. //
  29.  
  30.  
  31. import React from "react";
  32. import styled from 'styled-components';
  33.  
  34. const NumberButton = props => {
  35.   return (
  36.     <>
  37.       {/* Display a button element rendering the data being passed down from the parent container on props */
  38.       <StyledButton>{props.number}</StyledButton>
  39.       }
  40.     </>
  41.   );
  42. };
  43.  
  44. export default NumberButton;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top