Closed eddielisands closed 5 years ago
We can find <FormComponents.FormComponent ...> in FormGroup.jsx l160, FormGroupNone l56 and
FormGroupWithLine l158.
Each time its defined before: const FormComponents = this.props.formComponents;
I am not strong enough to tell if it is a typo and should be
Also, About forms, using package cloned from repo, I have an error telling we can not replace FormNestedHead as it has not been imported. I did not have time to investigate.
Hi @eddielisands, the SmartForm and its component should now accept a FormComponents
props for local override, eg if you want a specific input design for a given page. See this as a local replaceComponent
.
So there is no typo, it's just that the formComponents
should always be merged with the vulcan:core
Components
at the beginning of the render to guarantee that all components are defined.
vulcan-material-ui
might not be totally up-to-date on this because those are very recent changes to Vulcan (we merged a form cleanup just this morning in the core). It will however simplify further development of Vulcan UI packages so this is rather good news.
I invite you to take a look at the vulcan:forms
package, or even to submit a PR, those are good first issues once you get the Component replacement workflow. If you can't I'll try to fix them if I find some spare time.
@eric-burel Thanks for your information, but it breaks when I click new form and edit form in my app.
@Julien-Sytadelle That's what I did to fix the rendering issue at the moment.
@eric-burel Thanks for your information, but it breaks when I click new form and edit form in my app.
I have the same problem and did not have time to investigate yet (was reading vulcan doc...)
After update to latest version I have this error when opening an edit form: Cannot read property 'FormComponent' of undefined @FormGroup.jsx l160 so this.props.formComponents is undefined. FormGroup does not have default value for formComponents.
Which branch of the Vulcan codebase are you using with it? It should work with the most current devel branch.
I use a vulcan-starter clone using 1.12.8, not updated, and I have seen I should pass the missing prop to smartform. I just still not figured what I must put in the prop as I thought smartform did everything from the schema. I started node, meteor and vulcan last week so still learning (was using django untill now).
@Julien-Sytadelle if you want to use vulcan:material-ui, I'd suggest you to go for a 2-repo install of Vulcan http://docs.vulcanjs.org/#Two-Repo-Install-Optional. This way you'll enjoy the very last improvements of Vulcan and vulcan:material-ui. Let us know on the Vulcan Slack if you encounter issues, it's very active and helpful for beginners.
You can indeed pass formComponents={Components}
to the SmartForm, but it should not be necessary if you use the last version of Vulcan.
I will do this and let you know if I am still lost. Thanks!
Edit: remove email trace and by the way everything works fine with 3 repo install
'FormComponents.FormComponent' should be 'Components.FormComponent'?