Skip to content
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

Decouple from Remix to allow usage with React Router 6.4 #93

Merged
merged 15 commits into from
Nov 1, 2022

Conversation

danielweinmann
Copy link
Contributor

@danielweinmann danielweinmann commented Oct 28, 2022

This is a breaking change.

In order to decouple the lib from Remix, I thought of exporting createForm and createFormAction instead of Form and formAction.

The user will have to create their own Form and formAction by calling these functions and passing everything we need from Remix, React Router 6.4, or any other framework that implements the interfaces we need.

createForm will need to receive the following hooks: useNavigation (currently useTransition in Remix, but we'll use the React Router name), useSubmit, and useActionData.

createFormAction will need to receive a redirect and a json function.

@netlify
Copy link

netlify bot commented Oct 28, 2022

Deploy Preview for remix-forms ready!

Name Link
🔨 Latest commit c52c187
🔍 Latest deploy log https://app.netlify.com/sites/remix-forms/deploys/63603ae7541cae00083fc566
😎 Deploy Preview https://deploy-preview-93--remix-forms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@danielweinmann danielweinmann changed the title Use createForm and createFormAction instead of Form and formAction Decouple from Remix to allow usage with React Router 6.4 Oct 28, 2022
@danielweinmann danielweinmann marked this pull request as ready for review October 31, 2022 21:19
Copy link
Contributor

@gustavoguichard gustavoguichard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reviewed the whole code and it seems to be on point.
🚢 🚀

@danielweinmann danielweinmann merged commit 92b281f into main Nov 1, 2022
@danielweinmann danielweinmann deleted the create-form branch November 1, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants