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

Use form load initial values #1356

Merged
merged 7 commits into from Jul 30, 2020
Merged

Conversation

ncphillips
Copy link
Contributor

@ncphillips ncphillips commented Jul 28, 2020

The useForm hook was making a weird assumption that loadInitialValues should never execute if the CMS is disabled. This PR undoes that assumption and pushes the responsibility to the client. If a developer does not want to make a request in prod, then it's the their responsibility to make sure the loadInitialValues they define works that way.

Previously this function made the assumption that loadInitialValues
should only be run if the cms is enabled. This is presumptious.
If you want to not run this function when the cms is enabled then you
should make that check in your own code
@ncphillips ncphillips requested a review from a team as a code owner July 28, 2020 20:48
@ncphillips ncphillips marked this pull request as draft July 28, 2020 20:48
@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2020

Warnings
⚠️

packages/@tinacms/react-core was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

⚠️

packages/gatsby-tinacms-git was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

⚠️

packages/gatsby-tinacms-mdx was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

⚠️

packages/next-tinacms-json was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

⚠️

packages/next-tinacms-markdown was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

⚠️ @tinacms/dev please add to a Milestone before merging
⚠️ Update Docs for #1356

Create Issue

Modified Packages

The following packages were modified by this pull request:

  • @tinacms/react-core
  • gatsby-tinacms-git
  • gatsby-tinacms-mdx
  • next-tinacms-json
  • next-tinacms-markdown

Generated by 🚫 dangerJS against f3ba861

@kendallstrautman
Copy link
Contributor

Related to #1155

@ncphillips ncphillips marked this pull request as ready for review July 29, 2020 16:55
@ncphillips ncphillips added this to the 2020-08-03 milestone Jul 29, 2020
@ncphillips ncphillips merged commit b294595 into master Jul 30, 2020
@ncphillips ncphillips deleted the use-form-load-initial-values branch July 30, 2020 01:27
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.

None yet

3 participants