File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @form-example/app-mobile" ,
3- "version" : " 0.0.11 " ,
3+ "version" : " 0.0.12 " ,
44 "private" : true ,
55 "type" : " module" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " @form-example/app-pc" ,
3- "version" : " 0.0.11 " ,
3+ "version" : " 0.0.12 " ,
44 "private" : true ,
55 "type" : " module" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " @coding-form/root" ,
3- "version" : " 0.0.11 " ,
3+ "version" : " 0.0.12 " ,
44 "description" : " form-engine" ,
55 "main" : " index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " @coding-form/form-engine" ,
3- "version" : " 0.0.11 " ,
3+ "version" : " 0.0.12 " ,
44 "description" : " form-engine components" ,
55 "keywords" : [
66 " coding-form" ,
Original file line number Diff line number Diff line change @@ -11,17 +11,12 @@ interface FormItemType {
1111
1212export const registerFormItems = ( Form : any ,
1313 items : FormItemType [ ] ) => {
14+ FormRegistry . getInstance ( ) . register ( Form , ( ) => {
15+ const [ form ] = Form . useForm ( ) ;
16+ return form ;
17+ } ) ;
1418
15- const ref = React . useRef < any > ( ) ;
16-
17- if ( ! ref . current ) {
18- FormRegistry . getInstance ( ) . register ( Form , ( ) => {
19- const [ form ] = Form . useForm ( ) ;
20- return form ;
21- } ) ;
22-
23- for ( const item of items ) {
24- FormItemFactory . getInstance ( ) . register ( item . type , item . componentType ) ;
25- }
19+ for ( const item of items ) {
20+ FormItemFactory . getInstance ( ) . register ( item . type , item . componentType ) ;
2621 }
2722}
You can’t perform that action at this time.
0 commit comments