Skip to content

Commit c9a1ff1

Browse files
committed
[Translate] Complete use-transition Page
1 parent 34eba05 commit c9a1ff1

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

src/content/reference/react/useTransition.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,11 +1596,11 @@ root.render(
15961596
15971597
---
15981598
1599-
## Troubleshooting {/*troubleshooting*/}
1599+
## সমস্যা সমাধান {/*troubleshooting*/}
16001600
1601-
### Updating an input in a transition doesn't work {/*updating-an-input-in-a-transition-doesnt-work*/}
1601+
### একটি ট্রানজিশনে ইনপুট আপডেট করা কাজ করে না {/*updating-an-input-in-a-transition-doesnt-work*/}
16021602
1603-
You can't use a transition for a state variable that controls an input:
1603+
আপনি এমন একটি state ভেরিয়েবলের জন্য ট্রানজিশন ব্যবহার করতে পারবেন না যা একটি ইনপুট নিয়ন্ত্রণ করে:
16041604
16051605
```js {4,10}
16061606
const [text, setText] = useState('');
@@ -1615,16 +1615,16 @@ function handleChange(e) {
16151615
return <input value={text} onChange={handleChange} />;
16161616
```
16171617
1618-
This is because transitions are non-blocking, but updating an input in response to the change event should happen synchronously. If you want to run a transition in response to typing, you have two options:
1618+
এর কারণ হল ট্রানজিশনগুলি নন-ব্লকিং, কিন্তু change ইভেন্টের রেসপন্সে ইনপুট আপডেট করা অবশ্যই synchronous হওয়া উচিত। যদি আপনি টাইপ করার সময় একটি ট্রানজিশন চালাতে চান, তাহলে আপনার দুটি বিকল্প উপায় রয়েছে:
16191619
1620-
1. You can declare two separate state variables: one for the input state (which always updates synchronously), and one that you will update in a transition. This lets you control the input using the synchronous state, and pass the transition state variable (which will "lag behind" the input) to the rest of your rendering logic.
1621-
2. Alternatively, you can have one state variable, and add [`useDeferredValue`](/reference/react/useDeferredValue) which will "lag behind" the real value. It will trigger non-blocking re-renders to "catch up" with the new value automatically.
1620+
১. আপনি দুটি আলাদা state ভেরিয়েবল ঘোষণা করতে পারেন: একটি ইনপুট state এর জন্য (যা সর্বদা synchronously আপডেট হয়), এবং একটি যা আপনি ট্রানজিশনে আপডেট করবেন। এটি আপনাকে synchronous state ব্যবহার করে ইনপুট নিয়ন্ত্রণ করতে দেয়, এবং বাকি রেন্ডারিং লজিকে ট্রানজিশন state ভেরিয়েবল (যা ইনপুটের পিছনে "বিলম্বিত" হবে) পাস করতে দেয়।
1621+
২. বিকল্প হিসেবে, আপনি একটি state ভেরিয়েবল রাখতে পারেন, এবং [`useDeferredValue`](/reference/react/useDeferredValue) যোগ করতে পারেন যা বাস্তব মানের পিছনে "বিলম্বিত" হবে। এটি নতুন মানের সাথে "মেলে যাওয়ার" জন্য নন-ব্লকিং রি-রেন্ডারগুলি স্বয়ংক্রিয়ভাবে ট্রিগার করবে।
16221622
16231623
---
16241624
1625-
### React doesn't treat my state update as a transition {/*react-doesnt-treat-my-state-update-as-a-transition*/}
1625+
### React আমার state আপডেটকে ট্রানজিশন হিসেবে গ্রহণ করে না {/*react-doesnt-treat-my-state-update-as-a-transition*/}
16261626
1627-
When you wrap a state update in a transition, make sure that it happens *during* the `startTransition` call:
1627+
যখন আপনি একটি state আপডেটকে ট্রানজিশনে মোড়ান, নিশ্চিত করুন যে এটি `startTransition` কলের *সময়* ঘটে:
16281628
16291629
```js
16301630
startTransition(() => {
@@ -1633,9 +1633,9 @@ startTransition(() => {
16331633
});
16341634
```
16351635
1636-
The function you pass to `startTransition` must be synchronous.
1636+
`startTransition` এ আপনি যে ফাংশন পাস করবেন তা অবশ্যই synchronous হতে হবে।
16371637
1638-
You can't mark an update as a transition like this:
1638+
আপনি এভাবে একটি আপডেটকে ট্রানজিশন হিসেবে চিহ্নিত করতে পারবেন না:
16391639
16401640
```js
16411641
startTransition(() => {
@@ -1646,7 +1646,7 @@ startTransition(() => {
16461646
});
16471647
```
16481648
1649-
Instead, you could do this:
1649+
বরং, আপনি এটি করতে পারেন:
16501650
16511651
```js
16521652
setTimeout(() => {
@@ -1657,7 +1657,7 @@ setTimeout(() => {
16571657
}, 1000);
16581658
```
16591659
1660-
Similarly, you can't mark an update as a transition like this:
1660+
একইভাবে, আপনি একটি আপডেটকে এইরকম ট্রানজিশন হিসেবে চিহ্নিত করতে পারবেন না:
16611661
16621662
```js
16631663
startTransition(async () => {
@@ -1667,7 +1667,7 @@ startTransition(async () => {
16671667
});
16681668
```
16691669
1670-
However, this works instead:
1670+
তবে, এটি এর পরিবর্তে কাজ করে:
16711671
16721672
```js
16731673
await someAsyncFunction();
@@ -1679,15 +1679,15 @@ startTransition(() => {
16791679
16801680
---
16811681
1682-
### I want to call `useTransition` from outside a component {/*i-want-to-call-usetransition-from-outside-a-component*/}
1682+
### আমি একটি কম্পোনেন্টের বাইরে থেকে `useTransition` কল করতে চাই {/*i-want-to-call-usetransition-from-outside-a-component*/}
16831683
1684-
You can't call `useTransition` outside a component because it's a Hook. In this case, use the standalone [`startTransition`](/reference/react/startTransition) method instead. It works the same way, but it doesn't provide the `isPending` indicator.
1684+
আপনি একটি কম্পোনেন্টের বাইরে থেকে `useTransition` কল করতে পারবেন না কারণ এটি একটি Hook। এই ক্ষেত্রে, এর পরিবর্তে standalone [`startTransition`](/reference/react/startTransition) পদ্ধতি ব্যবহার করুন। এটি একইভাবে কাজ করে, কিন্তু এটি `isPending` ইন্ডিকেটর প্রদান করে না।
16851685
16861686
---
16871687
1688-
### The function I pass to `startTransition` executes immediately {/*the-function-i-pass-to-starttransition-executes-immediately*/}
1688+
### আমি যে ফাংশন `startTransition`-এ পাস করি তা তাৎক্ষণিকভাবে কার্যকর হয় {/*the-function-i-pass-to-starttransition-executes-immediately*/}
16891689
1690-
If you run this code, it will print 1, 2, 3:
1690+
আপনি যদি এই কোডটি চালান, তা 1, 2, 3 প্রিন্ট করবে:
16911691
16921692
```js {1,3,6}
16931693
console.log(1);
@@ -1698,7 +1698,7 @@ startTransition(() => {
16981698
console.log(3);
16991699
```
17001700
1701-
**It is expected to print 1, 2, 3.** The function you pass to `startTransition` does not get delayed. Unlike with the browser `setTimeout`, it does not run the callback later. React executes your function immediately, but any state updates scheduled *while it is running* are marked as transitions. You can imagine that it works like this:
1701+
**এটি 1, 2, 3 প্রিন্ট করার জন্য প্রত্যাশিত।** `startTransition`-এ আপনি যে ফাংশন পাস করেন তা দেরি হয় না। browser-এর `setTimeout`-এর মতো, এটি পরে কলব্যাক চালায় না। React আপনার ফাংশনটি তাৎক্ষণিকভাবে কার্যকর করে, কিন্তু *এটি চালানোর সময়* নির্ধারিত কোনো state আপডেটগুলি ট্রানজিশন হিসাবে চিহ্নিত হয়। এটি এভাবে কাজ করে বলে আপনি কল্পনা করতে পারেন:
17021702
17031703
```js
17041704
// A simplified version of how React works

0 commit comments

Comments
 (0)