New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Component - How to use ? #91
Comments
I'm trying to figure this out myself @mrbarletta. If/when I figure it out I'll let you know. |
great! this project needs some love! :) |
Has anyone come up against any kind of solution? My questions are:
|
I'm doing this:
But i get an error on this line in 'formiojs/build/components/Components.js' (line 457): |
The approach suggested by @Aiso786 above worked for me. I was able to duplicate the ES6 code of one of the stock components, change its class name and the name of the key string in the constructor, like this:
And then import and register the component in the React app's |
Looks like everyone figured it out. This approach will work with the 1.x version. In 2.x and later we depend on formio.js to render the form so the approach to build custom components is different. Here is how to do it in 2.x and 3.x branches https://gist.github.com/travist/59fa77086ec899e24992fc1508e61075 Note: The 4.x branch will change again (for the last time!) to support custom templating, SSR and better attaching of events. |
how to have react-formio custom component? |
@randallknutson - do you know how to create custom component with react-formio? |
Hello Tk, Please let me know if you have any further questions or concerns. Thanks, |
@wag110894 - thank you for the link. I can see there angular example, am I right? Can I find somewhere react example? |
You can see an example of a custom component in react like this: https://github.com/formio/react-app-starterkit/tree/3.x/src/components |
I feel like generating a unique element and render a react element to it, and then using something such as observable for syncing value in getValues and the element might be better? |
Hello IniZio, Can you please open this in a new chain. This issue has been non-responsive since March. Thanks, |
I couldn't find any information for react on how to use the custom component, any hint?
The text was updated successfully, but these errors were encountered: