formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

Formio integration in react native application for offline mode.

Open RichaMSaxena opened this issue 4 years ago • 5 comments

I'm creating a react native application and wanted to integrate the formio to work in offline mode.

You can find my code at https://github.com/RichaMSaxena/FormIOOffline.

I've implemented the online version of formio within my react native application and within web view, I was successfully able to render the form.

For the offline version, I have downloaded the formio.full.min.js file from https://github.com/formio/formio.js (from the dist folder) and pasted it in the src/assets folder in my react native application and created a webview with custom HTML, but that didn't work.

I also tried to download the formio.full.js from the following link "https://cdn.form.io/formiojs/formio.full.js", but that also didn't help. I got this link from the following page (https://formio.github.io/formio.js/)

On loading my application gives the error "TypeError: undefined is not an object (evaluating 'window.Event.prototype')", with the external formio.full.js link, but works fine when I use the online link i.e. https://cdn.form.io/formiojs/formio.full.js

Screen Shot 2022-10-06 at 7 46 43 PM

Can anyone please help me out with the integration of formio in react native application?

Thank you.

RichaMSaxena avatar Oct 06 '22 14:10 RichaMSaxena

Hello @RichaMSaxena,

Have you taken a look at this: https://github.com/formio/react-native-formio?

wag110894 avatar Oct 06 '22 20:10 wag110894

Hello @wag110894 , Yes, but this library had not been updated for the last 4 years, still, I tried it but it also gives an error at the time of import.

RichaMSaxena avatar Oct 07 '22 05:10 RichaMSaxena

@RichaMSaxena Use Gulp to bundle files into one HTML file(all min js , and html code to run formio) and use that HTML file as a source for the webview it should do the job

darshancreed avatar Oct 14 '22 07:10 darshancreed

I had the same problem, I use ionic with react js and it worked fine for me my app is already in production running 100% offline with no problem

gjagomez avatar Nov 03 '22 22:11 gjagomez

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

daneformio avatar Feb 07 '24 14:02 daneformio