Ad
  • Custom User Avatar

    I think this kata is a bit outdated, it would be nice to keep it up to date. The official recommendation after React 16.8 is to use functional components. Quick updated response:

    import React, { useState } from 'react';
    
    export function States() {
      const [united, setUnited] = useState(false);
      
      const unite = () => setUnited(!united);
      
      const message = united ? 'Code for everyone' : 'Make America code again';
      
      return <div className="status">{message}</div>;
    }