Skip to content

Instantly share code, notes, and snippets.

@Keldrik
Created August 4, 2019 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keldrik/e91b7a73ac2f89d02acca149032aadb0 to your computer and use it in GitHub Desktop.
Save Keldrik/e91b7a73ac2f89d02acca149032aadb0 to your computer and use it in GitHub Desktop.
import React, { useState, useEffect } from 'react';
const beispiel = () => {
const [count, setCount] = useState(0);
useEffect(() => {
document.title = `Du hast ${count} mal geklickt!`;
});
return (
<div>
<p>Du hast {count} mal geklickt!</p>
<button onClick={() => setCount(count + 1)}>
Klick mich!
</button>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment