sadmann7 / skateshop

An open source e-commerce skateshop build with everything new in Next.js.
https://skateshop.sadmn.com
MIT License
5.18k stars 743 forks source link

Bad use of transition #15

Open MetaX5 opened 1 year ago

MetaX5 commented 1 year ago

https://github.com/sadmann7/skateshop/blob/aaa1b2190d8a53a3aa0a9c248c4e3c4af3a06911/src/components/generate-button.tsx#L16

"The function you pass to startTransition must be synchronous." https://react.dev/reference/react/useTransition#react-doesnt-treat-my-state-update-as-a-transition

sadmann7 commented 1 year ago

Sophie from the react team said it will be changed soon. Things are working ok right now with async transactions.

Here is a tweet thread if you wanna learn more about transaction: https://twitter.com/sadmann17/status/1672417150378860544

sadmann7 commented 1 year ago

Duplicate of #1