diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6534403d..0739380f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -52,7 +52,7 @@ npm run precommit ## Coding standards Our code formatting rules are defined in -[.eslintrc](https://github.com/final-form/react-final-form/blob/master/.eslintrc). +[.eslintrc](https://github.com/final-form/react-final-form/blob/main/.eslintrc). You can check your code against these standards by running: ```sh diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e5cd6cf0..754e958d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,6 +21,6 @@ Please format the code before submitting your pull request by running: npm run precommit ``` -https://github.com/final-form/react-final-form/blob/master/.github/CONTRIBUTING.md +https://github.com/final-form/react-final-form/blob/main/.github/CONTRIBUTING.md --> diff --git a/.travis.yml b/.travis.yml index 93ba8100..f5add65b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ after_success: - npx codecov branches: only: - - master + - main diff --git a/README.md b/README.md index add1c179..06e58866 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ [![Backers on Open Collective](https://opencollective.com/final-form/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/final-form/sponsors/badge.svg)](#sponsors) [![NPM Version](https://img.shields.io/npm/v/react-final-form.svg?style=flat)](https://www.npmjs.com/package/react-final-form) [![NPM Downloads](https://img.shields.io/npm/dm/react-final-form.svg?style=flat)](https://www.npmjs.com/package/react-final-form) -[![Build Status](https://travis-ci.org/final-form/react-final-form.svg?branch=master)](https://travis-ci.org/final-form/react-final-form) -[![codecov.io](https://codecov.io/gh/final-form/react-final-form/branch/master/graph/badge.svg)](https://codecov.io/gh/final-form/react-final-form) +[![Build Status](https://travis-ci.org/final-form/react-final-form.svg?branch=main)](https://travis-ci.org/final-form/react-final-form) +[![codecov.io](https://codecov.io/gh/final-form/react-final-form/branch/main/graph/badge.svg)](https://codecov.io/gh/final-form/react-final-form) [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) ✅ Zero dependencies (that affect your bundle size) diff --git a/docs/examples.md b/docs/examples.md index aeb066b6..219a199d 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -4,7 +4,7 @@ --- -Wanna help? We need to migrate all of these examples from CodeSandbox to [here](https://github.com/final-form/react-final-form/tree/master/examples). PRs to help with that process would be greatly appreciated. 🙏 +Wanna help? We need to migrate all of these examples from CodeSandbox to [here](https://github.com/final-form/react-final-form/tree/main/examples). PRs to help with that process would be greatly appreciated. 🙏 --- diff --git a/docs/examples/chakra.md b/docs/examples/chakra.md index 39e0cffc..ad53d196 100644 --- a/docs/examples/chakra.md +++ b/docs/examples/chakra.md @@ -4,4 +4,4 @@ Demonstrates how to use [Chakra UI](https://chakra-ui.com) components with React Final Form. -[![Edit react-final-form-chakra-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/chakra) +[![Edit react-final-form-chakra-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/chakra) diff --git a/docs/examples/field-level-validation.md b/docs/examples/field-level-validation.md index a8a44bc1..7559b851 100644 --- a/docs/examples/field-level-validation.md +++ b/docs/examples/field-level-validation.md @@ -4,4 +4,4 @@ Introduces field-level validation functions and demonstrates how to display errors next to fields using child render functions. -[![Edit react-final-form-field-level-validation-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/field-level-validation) +[![Edit react-final-form-field-level-validation-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/field-level-validation) diff --git a/docs/examples/record-level-validation.md b/docs/examples/record-level-validation.md index 8a22388d..d1c3a0c1 100644 --- a/docs/examples/record-level-validation.md +++ b/docs/examples/record-level-validation.md @@ -4,4 +4,4 @@ Introduces a whole-record validation function and demonstrates how to display errors next to fields using child render functions. -[![Edit react-final-form-record-level-validation](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/record-level-validation) +[![Edit react-final-form-record-level-validation](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/record-level-validation) diff --git a/docs/examples/simple.md b/docs/examples/simple.md index 7463c27b..368168ea 100644 --- a/docs/examples/simple.md +++ b/docs/examples/simple.md @@ -4,4 +4,4 @@ Uses the built-in React inputs: input, select, and textarea to build a form with no validation. -[![Edit react-final-form-simple-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/simple) +[![Edit react-final-form-simple-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/simple) diff --git a/docs/examples/submission-errors.md b/docs/examples/submission-errors.md index ccbb63b4..c2e20d9f 100644 --- a/docs/examples/submission-errors.md +++ b/docs/examples/submission-errors.md @@ -4,4 +4,4 @@ Demonstrates how to return submission errors from failed submits. Notice that the `Promise` should _resolve_ to the submission error (not reject). Rejection is reserved for communications or server exceptions. -[![Edit react-final-form-submission-errors-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/submission-errors) +[![Edit react-final-form-submission-errors-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/submission-errors) diff --git a/docs/examples/subscriptions.md b/docs/examples/subscriptions.md index 8d754f61..07b213e0 100644 --- a/docs/examples/subscriptions.md +++ b/docs/examples/subscriptions.md @@ -4,4 +4,4 @@ Demonstrates how, by restricting which parts of form state the form component needs to render, it reduces the number of times the whole form has to rerender. Yet, if some part of form state is needed inside of it, the [``](../api/FormSpy) component can be used to attain it. -[![Edit react-final-form-subscriptions-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/subscriptions) +[![Edit react-final-form-subscriptions-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/subscriptions) diff --git a/docs/examples/wizard.md b/docs/examples/wizard.md index 7cb60f10..cd14d90e 100644 --- a/docs/examples/wizard.md +++ b/docs/examples/wizard.md @@ -4,4 +4,4 @@ Demonstrates how to use React Final Form to create a multi-page "wizard" form, with validation on each page. -[![Edit react-final-form-wizard-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/wizard) +[![Edit react-final-form-wizard-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/wizard) diff --git a/docs/faq.md b/docs/faq.md index 1241adb5..e431c81c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -42,6 +42,21 @@ a hassle and would add unnecessary bulk. This is a common question I see from people migrating from `redux-form`. There are three possible solutions: +### Via the `form` attribute + +You can provide the form id to a submit button. + + +```jsx + +{/* ^^^^^^^^^^^^^ */} + +
+{/* ^^^^^^^^^^^ */} + ...fields go here... +
+``` + ### Via `document.getElementById()` You can use the DOM to get a reference to your `
` element and dispatch a diff --git a/examples/chakra/readme.md b/examples/chakra/readme.md index 8a6634af..1c39405a 100644 --- a/examples/chakra/readme.md +++ b/examples/chakra/readme.md @@ -1,3 +1,3 @@ # Chakra UI Example -[![Edit react-final-form-chakra-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/chakra?fontsize=14) +[![Edit react-final-form-chakra-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/chakra?fontsize=14) diff --git a/examples/field-level-validation/readme.md b/examples/field-level-validation/readme.md index 674b2431..9cdfe63e 100644 --- a/examples/field-level-validation/readme.md +++ b/examples/field-level-validation/readme.md @@ -1,3 +1,3 @@ # Field Level Validation Example -[![Edit react-final-form-field-level-validation-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/field-level-validation?fontsize=14) +[![Edit react-final-form-field-level-validation-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/field-level-validation?fontsize=14) diff --git a/examples/record-level-validation/readme.md b/examples/record-level-validation/readme.md index a849f97d..ae3068fe 100644 --- a/examples/record-level-validation/readme.md +++ b/examples/record-level-validation/readme.md @@ -1,3 +1,3 @@ # Record Level Validation Example -[![Edit react-final-form-record-level-validation-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/record-level-validation?fontsize=14) +[![Edit react-final-form-record-level-validation-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/record-level-validation?fontsize=14) diff --git a/examples/simple/readme.md b/examples/simple/readme.md index 0209e888..0b6ee231 100644 --- a/examples/simple/readme.md +++ b/examples/simple/readme.md @@ -1,3 +1,3 @@ # Simple Example -[![Edit react-final-form-simple-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/simple?fontsize=14) +[![Edit react-final-form-simple-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/simple?fontsize=14) diff --git a/examples/submission-errors/readme.md b/examples/submission-errors/readme.md index 9bde00de..47169c94 100644 --- a/examples/submission-errors/readme.md +++ b/examples/submission-errors/readme.md @@ -1,3 +1,3 @@ # Submission Errors Example -[![Edit react-final-form-submission-errors-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/submission-errors?fontsize=14) +[![Edit react-final-form-submission-errors-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/submission-errors?fontsize=14) diff --git a/examples/subscriptions/readme.md b/examples/subscriptions/readme.md index 8742a46a..95e54b15 100644 --- a/examples/subscriptions/readme.md +++ b/examples/subscriptions/readme.md @@ -1,3 +1,3 @@ # Subscriptions Example -[![Edit react-final-form-subscriptions-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/subscriptions?fontsize=14) +[![Edit react-final-form-subscriptions-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/subscriptions?fontsize=14) diff --git a/examples/wizard/readme.md b/examples/wizard/readme.md index c230f739..09a6fdc4 100644 --- a/examples/wizard/readme.md +++ b/examples/wizard/readme.md @@ -1,3 +1,3 @@ # Wizard Form Example -[![Edit react-final-form-wizard-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/wizard?fontsize=14) +[![Edit react-final-form-wizard-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/final-form/react-final-form/tree/main/examples/wizard?fontsize=14)