diff --git a/packages/semi-ui/form/_story/ArrayField/remountInit.jsx b/packages/semi-ui/form/_story/ArrayField/remountInit.jsx new file mode 100644 index 0000000000..838d5887aa --- /dev/null +++ b/packages/semi-ui/form/_story/ArrayField/remountInit.jsx @@ -0,0 +1,55 @@ +import React, { useState } from 'react'; +import { ArrayField, TextArea, Form, Button, useFormState } from '@douyinfe/semi-ui'; +import { IconPlusCircle, IconMinusCircle } from '@douyinfe/semi-icons'; + +// toggle form input visible +// visible -> invisible -> visible +// initValue will not use in final round now +// The behavior in ArrayField is inconsistent with that in non-ArrayField, which is undefined behavior. Clearer guidance is needed. + +const RemountInit = () => { + const [data, setData] = useState([ + { name: 'arrayfield defualtValue' }, + ]); + const [visible, setVisible] = useState(true); + const ComponentUsingFormState = () => { + const formState = useFormState(); + return ( +