mirror of
https://github.com/swc-project/swc.git
synced 2025-01-01 01:56:06 +03:00
24 lines
507 B
TypeScript
24 lines
507 B
TypeScript
|
import { useEffect, useState } from 'react';
|
||
|
import { render } from 'react-dom';
|
||
|
|
||
|
import zhCN from 'antd/es/locale/zh_CN';
|
||
|
import { Button, ConfigProvider } from 'antd';
|
||
|
|
||
|
function App() {
|
||
|
const [state, setState] = useState({});
|
||
|
|
||
|
useEffect(() => {
|
||
|
(async () => {
|
||
|
setState(await fetch('/api/user'));
|
||
|
})();
|
||
|
}, []);
|
||
|
|
||
|
return (
|
||
|
<ConfigProvider locale={zhCN}>
|
||
|
state: {state}
|
||
|
<Button>Antd</Button>
|
||
|
</ConfigProvider>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
render(<App />, document.getElementById('root'));
|