如果您看到这篇文章,表示您的 blog 已经安装成功.

import React, { useState } from 'react';
function Example() {
    // 声明一个叫 “count” 的 state 变量。
    const [count, setCount] = useState(0);

    return (
    <div>
        <p>You clicked {count} times</p>
        <button onClick={() => setCount(count + 1)}>
        Click me
        </button>
    </div>
    );
}
Last modification:February 13th, 2020 at 02:28 am