Closed dohomi closed 2 years ago
Hey @dohomi! That contribution looks great 🙏
There were only a few problems running the unit tests.
Since that script is meant to run on the server side wouldn't we need to add the node-fetch
dependency first? I think we might have to split the lib into client/server side before doing this change, not sure if adding the node-fetch
dependency will mess up the build
@francisconeves97 just use isomorphic-unfetch
like its described here:
https://www.npmjs.com/package/isomorphic-unfetch#usage
import 'isomorphic-unfetch'; // on top of both, client and server once
This is how NextJS for example makes fetch calls on server/client automatically polyfilled
The idea is, that both client and server will use this function. so you can import it as well inside of the userGoogleForm hook. Currently you are writing the function 2 times
This is the code I am using right now. Works flawlessly.
This could be applied to the useGoogleForm hook as well and then the dependency could be removed.
Let the user decide which fetch fallback they would like to use.