رقصنده با کد
782 subscribers
1.69K photos
850 videos
207 files
666 links
Here are some interesting things I've come across during my learning process. That's it. Admin ID:
@alithecodeguy
Download Telegram
react 18.pdf
226.4 KB
راهنمای مختصر مفید از تغییرات React18
(ترجمه خودم)
#react #react18
اینکه ریکت رو به ورژن ۱۸ آپدیت کنید ، دلیل نمیشه زیرساخت جدیدش که concurrency باشه به صورت خودکار استفاده بشه. برای استفاده از زیرساخت جدید حتما باید از ویژگی‌های جدیدش استفاده کنید.
#react #react18
خیلی چیزا به ریکت ۱۸ اضافه شده از جمله هوک useTransition و هوک useDefferedValue.
هر دوش برای این به کار میره که اولویت render یک state به خصوص رو از بقیه stateها بیارن پایین‌تر.
ولی اینکه چه فرقی با هم دارن رو سخت میشه از روی داکیومنت اصلی متوجه شد.
این لینک خیلی کوتاه و مشروح و عملی این تفاوت رو شرح داده.
https://academind.com/tutorials/react-usetransition-vs-usedeferredvalue#:~:text=As%20mentioned%20above%2C%20the%20difference,same%20goal%20in%20the%20end.
——————
useTransition() gives you full control since you decide which code should be wrapped and treated as "low priority". Sometimes though, you might not have access to the actual state updating code (e.g., because it's performed by some third-party library). Or, for some reason, you can't use useTransition().

In such cases, you could use useDeferredValue() instead.

With useDeferredValue(), you don't wrap the state updating code but instead the value that's in the end generated or changed because of the state update (either the state value itself or some value that's computed based on the state value
——————
#react #react18 #hooks
هر چی بیشتر ریکت میخونم بیشتر متوجه میشم چه قدر این صفحه رو درک نکردم.
https://raw.githubusercontent.com/reactjs/reactjs.org/main/static/html/single-file-example.html
#ract #react18