0

What ES6 concept does the next line describe, please?

export default Form.create()(AbMemo);

Especially this: We instantiated Form.create() then again, in another parenthesis we pass component name?


Just in case, AbMemo Code.

const AbMemo = React.memo(({form, ...props}) => {
  const formChange = (e) => {

  };
  const {getFieldDecorator} = form;
    return (
      <div className="App" onChange={formChange}>
          <Form.Item className="firstName">
            {getFieldDecorator("firstName", {
              rules:[
                {required: true}
              ]
            })(<Input placeholder="FirstName" />)}
          </Form.Item>
          <Form.Item>
            <Button htmlType="submit" onClick={props.handleSubmit}>Submit</Button>
          </Form.Item>
      </div>)
    });

export default AbMemo;
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
  • `var func = Form.create(); func(AbMemo);` Nothing fancy. – Kaiido Dec 05 '19 at 07:03
  • @Kaiido, yes thanks. You can post as an answer. I will put tick mark on it. On a side note, would you also be knowing what is the meaning of, passing just the `component name` into Form.create()? – Abhijeet Dec 05 '19 at 07:10
  • What is `Form.create`? Does it come from a library or something, since I can't find documentation for it (lots of hits about forms in general). It might be a React thing but I'm not familiar with it. At any rate, there should be documentation describing what the argument there is. – VLAZ Dec 05 '19 at 07:15

0 Answers0