-
-
Notifications
You must be signed in to change notification settings - Fork 617
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: add useSetAtom docs #1104
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit dd4bf9e:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on improving docs!
A few requests for changes:
useSetAtom
is not injotai/utils
so it shouldn't be in utils.mdx or utils folder.- It should be in core.mdx, but we need to restructure them to split "Basic APIs" and "Additional APIs" See [RFC] useAtomValue and useSetAtom APIs in core #885. This might sound out of the scope of this PR, but we need the restructure anyway. Sorry, it hasn't be done yet.
useUpdateAtom
docs should be updated sayinguseSetAtom
is available. Same foruseAtomValue
in utils. This can be a separate PR.
Hello ! I've made some of the changes you suggested and they seem to work. |
docs/api/basic.mdx
Outdated
@@ -1,5 +1,5 @@ | |||
--- | |||
title: Core | |||
title: Basic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep core.mdx, and have two sections "Basic APIs" and "Additional APIs" in it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done.
docs/utils/use-update-atom.mdx
Outdated
@@ -4,6 +4,8 @@ title: useUpdateAtom | |||
|
|||
Ref: https://github.com/pmndrs/jotai/issues/26 | |||
|
|||
For newer versions of Jotai it's highly recomended to use [`useSetAtom`](/docs/api/additional.mdx#use-set-atom) instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that "highly". In v1, we keep exporting useUpdateAtom
from jotai/utils
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, makes sense. Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good. Thanks so much for your contribution.
Implements docs for
useSetAtom
.Closes #1019