This project is initialized with Ant Design Pro. Follow is the quick guide for how to use.
Install node_modules:
npm installor
yarnAnt Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
Scripts provided in package.json. It's safe to modify or add additional script:
npm startnpm run buildnpm run lintYou can also use script to auto fix some lint error:
npm run lint:fixnpm testYou can view full document on our official website. And welcome any feedback in our github.
一个简单的JavaScript实用程序,用于有条件地将类名连接在一起。
易于编写受控组件
import React, { useState } from 'react';
import useMergeState from 'use-merge-value';
const ControlledInput: React.FC<{ value: string; onChange: (value: string) => void }> = props => {
const [value, setValue] = useMergeState('', props);
return (
<div>
<input value={value} onChange={e => setValue(e.target.value)}></input>{' '}
</div>
);
};