Gravity Forms

Has anyone managed to successfully use React Gravity Forms (https://www.npmjs.com/package/react-gravity-form)? I get an error: “ReferenceError: regeneratorRuntime is not defined”

Now that I know I can tackle ACF/repeater fields, the only remaining hurdle for me is Gravity forms. I saw a thread Contact Forms like contact form 7 on CF7, which would not be quite the same.

BTW, thank you to the devs working on this project, I have been neglecting to get on board the React train because of my clients all being on the WP platform, but this is a serious game-changer.

I unfortunately can’t be of much help since I have not tried React Gravity Forms, but I was having an issue with React Fabric and the was because Frontity uses SSR (Server Side Rendering). I can’t confirm that is the issue that you are running into since I don’t have enough information. That being said, I hope it helps you troubleshoot it. Someone from Frontity will probably respond with more details soon :blush:

3 Likes

I didn’t know there was a React component for Gravity Forms. That’s quite interesting. Then creating a Frontity package should be fairly easy :slight_smile:

That’s because the transpiled version (its dist folder), expects @babel/polyfill. One way to solve could be installing it and requiring it in your code:

> npm install @babel/polyfill
import "@babel/polyfill";
import GravityForm from "react-gravity-form";

But that will add unnecessary Kbs to your bundle.

Frontity is able to transpile libraries from node_modules, so my recommendation is to use their non-transpiled code (its src folder) and let Frontity deal with the transpilation.

import GravityForm from "react-gravity-form/src";

Let me know if that works.

1 Like

Thank you, I will give that a try! I did get this to work on a vanilla react site, but realized the default endpoint in the plugin documentation is incorrect. Gravity forms requires Authentication for its REST endpoints, even to read the forms, and https://www.npmjs.com/package/react-gravity-form does not provide options for a key/secret field. I was able to get it working by creating a custom endpoint in WP and then changing the url to the custom one.

1 Like

Awesome. Let us know if you have more progress with this :slight_smile:

Were you ever able to get Gravity Forms working as a Frontity package?

I am interested about how this works. Would you maybe want to elaborate about how to get Gravity Forms working with Frontity?

@luisherranz wouldn’t it be great to have some documentation about how to integrate forms in Frontity? I can’t really find any information about this.

Hi @dominique

Regarding this, we have created an issue to have a look at it and try to provide a better explanation on this → https://github.com/frontity/gitbook-docs/issues/109

Feel free to comment on the issue to add any specific information you missed from the docs so we can take it into account when we work on this.

Thanks a lot for your feedback

Hi :wave:

I know it’s not what you asked for but maybe you would want to check the code of the Contact Form 7 Frontity package. At least you can see how a form package is supposed to work. :blush:

Good morning, I don’t know if I’m going to be able to contribute, but it seems that version 2.5 of GF that already came out in beta this summer, brings many new functionalities on the REST API: https://docs.gravityforms.com/web-api/

I hope you have a happy day