coryhouse / coryhouse/react-restaurant-scriptpro

Add submit-rating form with useOptimistic

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
enhancement phase-7-ratings
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Goal
Add a submit-rating form below `FoodRatings`. Use `useOptimistic` to insert the new rating into the list instantly, then reconcile with the server response. Roll back on error.

## Acceptance criteria
- [ ] Form posts to the mock API via `useMutation`
- [ ] `useOptimistic` adds the new rating immediately
- [ ] On error, the optimistic rating is removed and an error toast appears
- [ ] On success, the list reflects the server-confirmed rating

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.