Advertisement
shopnilSS

Untitled

Mar 15th, 2024
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import React from 'react';
  2. import styles from './index.module.scss';
  3.  
  4. export const DigitShowView = () => {
  5. const renderDigits = () => {
  6. const digits = [];
  7. for (let i = 1; i <= 100; i++) {
  8. digits.push(
  9. <div
  10. key={i}
  11. className={`${styles.digit} ${
  12. i % 2 === 0 ? styles.even : styles.odd
  13. }`}
  14. >
  15. {i}
  16. </div>
  17. );
  18. }
  19. return digits;
  20. };
  21.  
  22. return <div className={styles.digitDisplay}>{renderDigits()}</div>;
  23. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement