builder icon indicating copy to clipboard operation
builder copied to clipboard

"Get generated code" doesn't seem to output working code

Open nsangwan opened this issue 4 years ago • 3 comments

I created a form and generated its code for React.

The generated code seems to expect @builder.io/react components like - FormForm, FormInput, FormLabel, FormTextArea, FormSubmitButton. Is that correct?

If yes.

Issue 1: These components are not imported in the generated code.

Issue 2: Some of these components seemed to be aliased - e.g. FormForm from Form, FormTextArea from TextArea which makes it even harder to map them to actual components.

nsangwan avatar Jun 30 '21 06:06 nsangwan

hey @nsangwan - looks like you caught that we haven't implemented our form components into the compiler yet! Thanks for the reminder, will leave this ticket open to remind us to get to this :)

steve8708 avatar Jun 30 '21 18:06 steve8708

@steve8708 thanks for acknowledging. Planning to implement anytime in foreseeable future?

nsangwan avatar Jul 04 '21 12:07 nsangwan

absolutely, hopefully in the next few weeks. and in the meantime you can generally just swap out the components to the last part of their name, lowercased, e.g. by hand:

<FormForm> -> <form>
<FormInput> -> <input>
<FormLabel> -> <label>

etc

You can see the full implementations over here. They are all quite simple, e.g. Button is here

steve8708 avatar Jul 13 '21 21:07 steve8708