zidniryi

App.js

Oct 20th, 2021
705
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { useToggle } from './useToggle';
  2.  
  3. function App() {
  4.     // Memanggil Toggle Custom Hooks
  5.     const [isTextChanged, setIsTextChanged] = useToggle();
  6.    
  7.     return (
  8.        <div>
  9.          <h1>{isTextChanged ? 'Toggled' : 'Click to Toggle'}</h1>
  10.           <button onClick={setIsTextChanged}> Hooks Button</button>
  11.        </div>
  12.     );
  13. }
  14.  
  15. export default App;
  16.  
RAW Paste Data