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

docs: fix useActionData/useLoaderData usage #4684

Conversation

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2022

⚠️ No Changeset found

Latest commit: e9d3ecd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MichaelDeBoey MichaelDeBoey force-pushed the fix-useActionData-useLoaderData-usage-in-docs branch from 295f396 to 6642dd2 Compare November 28, 2022 21:44
Copy link
Contributor

@pcattori pcattori left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on! Docs updates can be tedious and we really appreciate it 🙏

It's looking quite good! Just left a couple comments mostly about updating highlighted lines in code examples.

docs/api/remix.md Show resolved Hide resolved
docs/guides/data-loading.md Outdated Show resolved Hide resolved
docs/pages/philosophy.md Outdated Show resolved Hide resolved
docs/tutorials/blog.md Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
docs/tutorials/jokes.md Outdated Show resolved Hide resolved
@MichaelDeBoey MichaelDeBoey force-pushed the fix-useActionData-useLoaderData-usage-in-docs branch from 6642dd2 to e9d3ecd Compare November 30, 2022 20:22
@MichaelDeBoey
Copy link
Member Author

Thanks for the thorough review @pcattori! 🙏

Fixed all the remarks & some minor other things as well, so should be good to be merged now.

@pcattori pcattori merged commit 65cba48 into remix-run:main Nov 30, 2022
@MichaelDeBoey MichaelDeBoey deleted the fix-useActionData-useLoaderData-usage-in-docs branch November 30, 2022 21:44
@petetnt
Copy link
Contributor

petetnt commented Dec 9, 2022

Hi @MichaelDeBoey, this PR causes issues (or leaves them unfixed?) at least with docs/guides/data-writes.md where setting defaultValues as per the documentation throws the following type error (see https://remix.run/docs/en/v1/guides/data-writes#graduate-to-form-and-add-pending-ui):

Type 'string | SerializeObject<UndefinedToOptional<File>> | undefined' is not assignable to type 'string | number | readonly string[] | undefined'.
  Type 'SerializeObject<UndefinedToOptional<File>>' is not assignable to type 'string | number | readonly string[] | undefined'.ts(2322)
index.d.ts(1851, 9): The expected type comes from property 'defaultValue' which is declared here on type 'DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>'

I can make a PR to fix it, but not actually sure if it's supposed to work that way (I'm a Remix noob)

edit: Or that the issue is that the values are returned with Object.entries(formData), explicitly changing that to {name: formData.get('name')?.toString(), password: formData.get('password')?.toString()} makes them string | undefined that doesn't cause issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add SerializeFrom to Developer Blog Tutorial
4 participants