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

Fix react-tutorial: typo, navbar reference and improve error handlig #1495

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

ebenezerdon
Copy link
Contributor

What does this PR do?

Updates doc React tutorial

  • Add error handling to Ideas context
  • Add database creation instructions
  • Fix form submission clearing

Test Plan

  • Run the app and navigate to /docs/tutorials/react/step-7
  • Confirm that updates are accurate

…dling

- Add error handling to Ideas context
- Add database creation instructions
- Fix form submission clearing
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

All of our tutorials should be the same so these changes will need to be replicated to the other tutorials as well

@@ -56,30 +64,43 @@ export function useIdeas() {

export function IdeasProvider(props) {
const [ideas, setIdeas] = useState([]);
const [error, setError] = useState(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

This error doesn't look like it's used anywhere 🧐

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it in case the user wanted to do something with the state (was setting the state in the catch block) but I've removed it now

Comment on lines 12 to 13
3. Give it a name (e.g. "ideas-tracker")
4. Save the database ID as you'll need it later
Copy link
Contributor

Choose a reason for hiding this comment

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

The collection screenshot has "Ideas Tracker" for the name and "ideas-tracker" for the ID so let's use something similar for the database ID and name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I've clarified the instruction

src/routes/docs/tutorials/react/step-6/+page.markdoc Outdated Show resolved Hide resolved
@stnguyen90 stnguyen90 merged commit 2f26268 into main Nov 19, 2024
1 check passed
@stnguyen90 stnguyen90 deleted the fix-doc-react-tutorial branch November 19, 2024 22:51
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