docs/intro #179
Unanswered
docs/intro
#179
Replies: 1 comment
-
hello iam zaxro function Clock(props) {
const [date, setDate] = useState(new Date());
useEffect(() => {
const timerID = setInterval(() => tick(), 1000);
return function cleanup() {
clearInterval(timerID);
};
});
function tick() {
setDate(new Date());
}
return (
<div>
<h2>It is {date.toLocaleTimeString()}.</h2>
</div>
);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
docs/intro
Let's discover Docusaurus in less than 5 minutes.
http://localhost:3000/docs/intro
Beta Was this translation helpful? Give feedback.
All reactions