Skip to content

Commit a9bb2cd

Browse files
committed
fix: resolve merge conflict and update Bengali translation for hydrateRoot documentation
1 parent e21f894 commit a9bb2cd

1 file changed

Lines changed: 24 additions & 41 deletions

File tree

src/content/reference/react-dom/client/hydrateRoot.md

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,10 @@ const root = hydrateRoot(domNode, reactNode);
4141
4242
* **optional** `options`: এই React root এর জন্য বিভিন্ন option সংবলিত একটি অবজেক্ট।
4343
44-
<<<<<<< HEAD
45-
* **optional** `onRecoverableError`: যখন React স্বয়ংক্রিয় ভাবে কোন error থেকে নিজেকে recover করে তখন হওয়া কলব্যাক।
46-
* **optional** `identifierPrefix`: [`useId`](/reference/react/useId) দিয়ে তৈরী হওয়া ID গুলোর জন্য React যে string prefix ব্যবহার করে। একই পেইজে যখন একাধিক rot থাকে তখন conflict এড়াতে এটা কাজে লাগে।
47-
=======
48-
* **optional** `onCaughtError`: Callback called when React catches an error in an Error Boundary. Called with the `error` caught by the Error Boundary, and an `errorInfo` object containing the `componentStack`.
49-
* **optional** `onUncaughtError`: Callback called when an error is thrown and not caught by an Error Boundary. Called with the `error` that was thrown and an `errorInfo` object containing the `componentStack`.
50-
* **optional** `onRecoverableError`: Callback called when React automatically recovers from errors. Called with the `error` React throws, and an `errorInfo` object containing the `componentStack`. Some recoverable errors may include the original error cause as `error.cause`.
51-
* **optional** `identifierPrefix`: A string prefix React uses for IDs generated by [`useId`.](/reference/react/useId) Useful to avoid conflicts when using multiple roots on the same page. Must be the same prefix as used on the server.
52-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
44+
* **optional** `onCaughtError`: Error Boundary এ React কোন error ধরলে কল হওয়া callback। Error Boundary এর ধরা `error` এবং `componentStack` সংবলিত `errorInfo` অব্জেক্ট দিয়ে কল করা হয়।
45+
* **optional** `onUncaughtError`: কোন error throw হয়ে Error Boundary এর মাধ্যমে ধরা না হলে কল হওয়া callback। Throw হওয়া `error` এবং `componentStack` সংবলিত `errorInfo` অব্জেক্ট দিয়ে কল করা হয়।
46+
* **optional** `onRecoverableError`: যখন React স্বয়ংক্রিয়ভাবে error থেকে recover করে তখন কল হওয়া callback। React এর throw করা `error` এবং `componentStack` সংবলিত `errorInfo` অব্জেক্ট দিয়ে কল করা হয়। কিছু recoverable error এর মূল কারণ `error.cause` হিসেবে থাকতে পারে।
47+
* **optional** `identifierPrefix`: [`useId`](/reference/react/useId) দিয়ে তৈরী হওয়া ID গুলোর জন্য React যে string prefix ব্যবহার করে। একই পেইজে যখন একাধিক root থাকে তখন conflict এড়াতে এটা কাজে লাগে। সার্ভারে ব্যবহৃত prefix এর সাথে একই হতে হবে।
5348
5449
5550
#### রিটার্ন {/*returns*/}
@@ -88,7 +83,7 @@ React hydrated `root` এর ভেতরে থাকা `<App />` আপডে
8883
8984
#### সতর্কতা {/*root-render-caveats*/}
9085
91-
* রুটের hydrating শেষ হবার আগে আপনি যদি `root.render` কল করেন, তাহলে React সার্ভার-রেন্ডার্ড HTML মুছে ফেলবে এবং সম্পূর্ণ রুটটাকে ক্লায়েন্ট রেন্ডারিং এর জন্য তৈরী করে ফেলবে
86+
* রুটের hydrating শেষ হবার আগে আপনি `root.render` কল করার চেষ্টা করেন, তাহলে React সার্ভার-রেন্ডার্ড HTML মুছে ফেলবে এবং সম্পূর্ণ রুটটাকে ক্লায়েন্ট রেন্ডারিং এর জন্য তৈরী করবে
9287
9388
---
9489
@@ -104,16 +99,12 @@ root.unmount();
10499
105100
এটা তখন সবচেয়ে কাজে লাগে যদি আপনার React রুটের DOM নোড (বা এর কোন ancestor) অন্য কোন কোডের কারণে DOM থেকে মুছে যায়। উদাহরণস্বরূপ, ধরে একটা jQuery ট্যাব প্যানেল আছে যা DOM থেকে অচল ট্যাবগুলো মুছে ফেলে। যদি একটা ট্যাব মুছে যায় তবে এর ভেতর থাকা সব কিছুও (ভিতরে থাকা React রুটগুলো সহ) DOM থেকে মুছে যাবে। সেক্ষেত্রে, `root.unmount` কল করার মাধ্যমে আপনার React কে বলতে হবে মুছে যাওয়া রুটের কনটেন্ট ম্যানেজ করা "বন্ধ" করতে। না হলে, মুছে যাওয়া রুটের ভেতরকার কম্পোনেন্ট সাবস্ক্রিপশনের মত global resource মুছবে না এবং সেগুলো ফ্রি হবে না।
106101
107-
<<<<<<< HEAD
108102
`root.unmount` কল করলে রুটের সব কম্পোনেন্ট আনমাউন্ট হবে এবং রুট DOM নোড থেকে React "detach" হয়ে যাবে। একই সাথে ট্রিতে কোন ইভেন্ট হ্যান্ডলার বা স্টেট থাকলে সেটাও মুছে যাবে।
109-
=======
110-
Calling `root.unmount` will unmount all the components in the root and "detach" React from the root DOM node, including removing any event handlers or state in the tree.
111-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
112103
113104
114105
#### প্যারামিটার {/*root-unmount-parameters*/}
115106
116-
`root.unmount` does not accept any parameters.
107+
`root.unmount` কোন প্যারামিটার গ্রহণ করে না।
117108
118109
119110
#### রিটার্ন {/*root-unmount-returns*/}
@@ -279,11 +270,7 @@ export default function App() {
279270
280271
</Sandpack>
281272
282-
<<<<<<< HEAD
283273
এটা শুধুমাত্র এক স্তর গভীরে কাজ করে, এবং এর উদ্দেশ্য একটা escape hatch এর মত কাজ করা। এর অতিরিক্ত ব্যবহার এড়িয়ে চলুন। যদি না এটা টেক্সট কনটেন্ট হয়, React একে প্যাচ আপ করার চেষ্টা করবে না, সুতরাং এটা ভবিষ্যতে আপডেট হবার আগ পর্যন্ত অসামাঞ্জস্যপূর্ন থাকতে পারে।
284-
=======
285-
This only works one level deep, and is intended to be an escape hatch. Don’t overuse it. React will **not** attempt to patch mismatched text content.
286-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
287274
288275
---
289276
@@ -385,14 +372,11 @@ export default function App({counter}) {
385372
386373
</Sandpack>
387374
388-
<<<<<<< HEAD
389-
একটা hydrated রুটে [`root.render`](#root-render) কল করার বিষয়টা বিরল। সাধারণত, আপনি এর বদলে কম্পোনেন্টগুলোর কোন একটির মধ্যে [state আপডেট](/reference/react/useState) করবেন।
390-
=======
391-
It is uncommon to call [`root.render`](#root-render) on a hydrated root. Usually, you'll [update state](/reference/react/useState) inside one of the components instead.
375+
একটা hydrated রুটে [`root.render`](#root-render) কল করার বিষয়টা বিরল। সাধারণত, আপনি এর বদলে কম্পোনেন্টগুলোর কোন একটির মধ্যে [state আপডেট](/reference/react/useState) করবেন।
392376
393-
### Error logging in production {/*error-logging-in-production*/}
377+
### প্রোডাকশনে error logging {/*error-logging-in-production*/}
394378
395-
By default, React will log all errors to the console. To implement your own error reporting, you can provide the optional error handler root options `onUncaughtError`, `onCaughtError` and `onRecoverableError`:
379+
ডিফল্ট অনুযায়ী, React সমস্ত error console এ log করে। নিজস্ব error reporting বাস্তবায়ন করতে, আপনি ঐচ্ছিক error handler root option `onUncaughtError`, `onCaughtError` এবং `onRecoverableError` প্রদান করতে পারেনঃ
396380
397381
```js [[1, 7, "onCaughtError"], [2, 7, "error", 1], [3, 7, "errorInfo"], [4, 11, "componentStack", 15]]
398382
import { hydrateRoot } from "react-dom/client";
@@ -412,19 +396,19 @@ const root = hydrateRoot(container, <App />, {
412396
});
413397
```
414398
415-
The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with two arguments:
399+
<CodeStep step={1}>onCaughtError</CodeStep> option টি দুটি আর্গুমেন্ট সহ কল করা একটি function:
416400
417-
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
418-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
401+
1. <CodeStep step={2}>error</CodeStep> যা throw করা হয়েছিল।
402+
2. একটি <CodeStep step={3}>errorInfo</CodeStep> অব্জেক্ট যাতে error এর <CodeStep step={4}>componentStack</CodeStep> রয়েছে।
419403
420-
Together with `onUncaughtError` and `onRecoverableError`, you can implement your own error reporting system:
404+
`onUncaughtError` এবং `onRecoverableError` এর সাথে একত্রে, আপনি নিজের error reporting system বাস্তবায়ন করতে পারেনঃ
421405
422406
<Sandpack>
423407
424408
```js src/reportError.js
425409
function reportError({ type, error, errorInfo }) {
426-
// The specific implementation is up to you.
427-
// `console.error()` is only used for demonstration purposes.
410+
// নির্দিষ্ট বাস্তবায়ন আপনার উপর নির্ভর করে।
411+
// `console.error()` শুধুমাত্র প্রদর্শনের উদ্দেশ্যে ব্যবহার করা হয়েছে।
428412
console.error(type, error, "Component Stack: ");
429413
console.error("Component Stack: ", errorInfo.componentStack);
430414
}
@@ -455,9 +439,9 @@ import {
455439

456440
const container = document.getElementById("root");
457441
hydrateRoot(container, <App />, {
458-
// Keep in mind to remove these options in development to leverage
459-
// React's default handlers or implement your own overlay for development.
460-
// The handlers are only specfied unconditionally here for demonstration purposes.
442+
// মনে রাখবেন development এ React এর default handler ব্যবহার করতে বা
443+
// development এর জন্য নিজস্ব overlay বাস্তবায়ন করতে এই option গুলো সরান।
444+
// handler গুলো শুধুমাত্র প্রদর্শনের উদ্দেশ্যে নিঃশর্তভাবে নির্দিষ্ট করা হয়েছে।
461445
onCaughtError: onCaughtErrorProd,
462446
onRecoverableError: onRecoverableErrorProd,
463447
onUncaughtError: onUncaughtErrorProd,
@@ -525,25 +509,24 @@ export default function App() {
525509
```
526510
</Sandpack>
527511
528-
## Troubleshooting {/*troubleshooting*/}
512+
## সমস্যা সমাধান {/*troubleshooting*/}
529513
530514
531-
### I'm getting an error: "You passed a second argument to root.render" {/*im-getting-an-error-you-passed-a-second-argument-to-root-render*/}
515+
### আমি একটি error পাচ্ছি: "You passed a second argument to root.render" {/*im-getting-an-error-you-passed-a-second-argument-to-root-render*/}
532516
533-
A common mistake is to pass the options for `hydrateRoot` to `root.render(...)`:
517+
একটি সাধারণ ভুল হল `hydrateRoot` এর option গুলো `root.render(...)` এ পাস করাঃ
534518
535519
<ConsoleBlock level="error">
536520
537521
Warning: You passed a second argument to root.render(...) but it only accepts one argument.
538522
539523
</ConsoleBlock>
540524
541-
To fix, pass the root options to `hydrateRoot(...)`, not `root.render(...)`:
525+
ঠিক করতে, root option গুলো `hydrateRoot(...)` এ পাস করুন, `root.render(...)` এ নয়ঃ
542526
```js {2,5}
543-
// 🚩 Wrong: root.render only takes one argument.
527+
// 🚩 ভুল: root.render শুধুমাত্র একটি আর্গুমেন্ট নেয়।
544528
root.render(App, {onUncaughtError});
545529

546-
//Correct: pass options to createRoot.
530+
//সঠিক: option গুলো hydrateRoot এ পাস করুন।
547531
const root = hydrateRoot(container, <App />, {onUncaughtError});
548532
```
549-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91

0 commit comments

Comments
 (0)