Skip to content

Commit ae6d5c4

Browse files
committed
translate: import and export multiple component
1 parent 6f849f8 commit ae6d5c4

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/content/learn/importing-and-exporting-components.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ React এ `'./Gallery.js'` অথবা `'./Gallery'` দুটিই কাজ
136136

137137
যেভাবে আপনি কম্পোনেন্ট এক্সপোর্ট করবেন তার উপর নির্ভর করে আপনাকে কম্পোনেন্টটি ইম্পোর্ট করতে হবে। আপনি যদি একটি ডিফল্ট এক্সপোর্ট কে ইম্পোর্ট করার জন্য নেমড এক্সপোর্ট এর মত করে কোড লিখেন তাহলে আপনি একটি এরর পাবেন। এই চার্ট আপনাকে সহজে সাহায্য করতে পারবেঃ
138138

139-
| Syntax | এক্সপোর্ট স্টেটমেন্ট | ইম্পোর্ট স্টেটমেন্ট |
139+
| সিনট্যাক্স | এক্সপোর্ট স্টেটমেন্ট | ইম্পোর্ট স্টেটমেন্ট |
140140
| ----------- | ----------- | ----------- |
141141
| ডিফল্ট | `export default function Button() {}` | `import Button from './Button.js';` |
142142
| নেমড | `export function Button() {}` | `import { Button } from './Button.js';` |
@@ -147,39 +147,39 @@ React এ `'./Gallery.js'` অথবা `'./Gallery'` দুটিই কাজ
147147

148148
</DeepDive>
149149

150-
## Exporting and importing multiple components from the same file {/*exporting-and-importing-multiple-components-from-the-same-file*/}
150+
## একটি ফাইল থেকে একাধিক কম্পোনেন্ট ইম্পোর্ট এবং এক্সপোর্ট করা {/*exporting-and-importing-multiple-components-from-the-same-file*/}
151151

152-
What if you want to show just one `Profile` instead of a gallery? You can export the `Profile` component, too. But `Gallery.js` already has a *default* export, and you can't have _two_ default exports. You could create a new file with a default export, or you could add a *named* export for `Profile`. **A file can only have one default export, but it can have numerous named exports!**
152+
ধরুন আপনি গ্যালারির পরিবর্তে একটিমাত্র `Profile` দেখাতে চাচ্ছেন। তাহলে আপনি `Profile` কম্পোনেন্ট টাও এক্সপোর্ট করতে পারবেন। কিন্তু `Gallery.js` ফাইলে ইতিমধ্যে একটি *ডিফল্ট* এক্সপোর্ট আছে এবং একটি ফাইল এ _দুইটি_ ডিফল্ট এক্সপোর্ট থাকতে পারে না। আপনি একটি নতুন ফাইল তৈরি করে সেটি থেকে ডিফল্ট এক্সপোর্ট করতে পারেন অথবা `Profile` এর জন্য একটি *নেমড* এক্সপোর্ট যোগ করতে পারেন। **একটি ফাইলে শুধুমাত্র একটি ডিফল্ট এক্সপোর্ট থাকতে পারে কিন্তু নেমড এক্সপোর্ট একাধিক থাকতে পারে!**
153153

154154
<Note>
155155

156-
To reduce the potential confusion between default and named exports, some teams choose to only stick to one style (default or named), or avoid mixing them in a single file. Do what works best for you!
156+
ডিফল্ট এবং নেমড এক্সপোর্ট এর মধ্যে বিভ্রান্তি এড়ানোর জন্য কিছু দল শুধুমাত্র একটি স্টাইল (ডিফল্ট বা নেমড) ব্যবহার করতে পছন্দ করে এবং একটি ফাইলে একাধিক স্টাইলের ব্যাবহার এড়িয়ে চলে। আপনার কাজের জন্য যেটি ভালো মনে হয় সেটি ব্যাবহার করুন।
157157

158158
</Note>
159159

160-
First, **export** `Profile` from `Gallery.js` using a named export (no `default` keyword):
160+
প্রথমত নেমড এক্সপোর্ট ব্যবহার করে `Gallery.js` থেকে `Profile` **এক্সপোর্ট** করুন (কোন `default` কীওয়ার্ড নেই):
161161

162162
```js
163163
export function Profile() {
164164
// ...
165165
}
166166
```
167167

168-
Then, **import** `Profile` from `Gallery.js` to `App.js` using a named import (with the curly braces):
168+
এরপর নেমড ইম্পোর্ট ব্যাবহার করে `App.js` থেকে `Gallery.js` এর `Profile` কম্পোনেন্ট **ইম্পোর্ট** করুন (দ্বিতীয় বন্ধনী সহ):
169169

170170
```js
171171
import { Profile } from './Gallery.js';
172172
```
173173

174-
Finally, **render** `<Profile />` from the `App` component:
174+
সবশেষে `App` কম্পোনেন্ট থেকে `<Profile />` **রেন্ডার** করুন:
175175

176176
```js
177177
export default function App() {
178178
return <Profile />;
179179
}
180180
```
181181

182-
Now `Gallery.js` contains two exports: a default `Gallery` export, and a named `Profile` export. `App.js` imports both of them. Try editing `<Profile />` to `<Gallery />` and back in this example:
182+
এখন `Gallery.js` এ দুটি এক্সপোর্ট আছে: একটি ডিফল্ট `Gallery` এক্সপোর্ট এবং একটি নেমড `Profile` এক্সপোর্ট। `App.js` উভয়ই ইম্পোর্ট করে। এই উদাহরণে `<Profile />` কে `<Gallery />` তে পরিবর্তন করে দেখুনঃ
183183

184184
<Sandpack>
185185

@@ -222,47 +222,47 @@ img { margin: 0 10px 10px 0; height: 90px; }
222222

223223
</Sandpack>
224224

225-
Now you're using a mix of default and named exports:
225+
এখানে আপনি ডিফল্ট এবং নেমড এক্সপোর্ট এর মিশ্রণ ব্যবহার করছেনঃ
226226

227227
* `Gallery.js`:
228-
- Exports the `Profile` component as a **named export called `Profile`.**
229-
- Exports the `Gallery` component as a **default export.**
228+
- `Profile` কম্পোনেন্ট কে **নেমড এক্সপোর্ট হিসেবে `Profile` নামে এক্সপোর্ট** করে।
229+
- `Gallery` কম্পোনেন্ট কে **ডিফল্ট এক্সপোর্ট হিসেবে** এক্সপোর্ট করে।
230230
* `App.js`:
231-
- Imports `Profile` as a **named import called `Profile`** from `Gallery.js`.
232-
- Imports `Gallery` as a **default import** from `Gallery.js`.
233-
- Exports the root `App` component as a **default export.**
231+
- `Profile` কে **নেমড ইম্পোর্ট হিসেবে `Profile` নামে** `Gallery.js` থেকে ইম্পোর্ট করে।
232+
- `Gallery` কে **ডিফল্ট ইম্পোর্ট হিসেবে** `Gallery.js` থেকে ইম্পোর্ট করে।
233+
- রুট `App` কম্পোনেন্ট কে **ডিফল্ট এক্সপোর্ট হিসেবে** এক্সপোর্ট করে।
234234

235235
<Recap>
236236

237-
On this page you learned:
237+
এই পৃষ্ঠায় আপনি শিখলেনঃ
238238

239-
* What a root component file is
240-
* How to import and export a component
241-
* When and how to use default and named imports and exports
242-
* How to export multiple components from the same file
239+
* রুট কম্পোনেন্ট ফাইল কি
240+
* কিভাবে কম্পোনেন্ট ইম্পোর্ট এবং এক্সপোর্ট করা হয়
241+
* কখন এবং কিভাবে ডিফল্ট এবং নেমড ইম্পোর্ট এবং এক্সপোর্ট ব্যবহার করা হয়
242+
* একই ফাইল থেকে একাধিক কম্পোনেন্ট এক্সপোর্ট করার পদ্ধতি
243243

244244
</Recap>
245245

246246

247247

248248
<Challenges>
249249

250-
#### Split the components further {/*split-the-components-further*/}
250+
#### কম্পোনেন্টকে আরো ভাগ করুন {/*split-the-components-further*/}
251251

252-
Currently, `Gallery.js` exports both `Profile` and `Gallery`, which is a bit confusing.
252+
বর্তমানে `Gallery.js` ফাইল থেকে `Profile` এবং `Gallery` উভয়ই এক্সপোর্ট করা হয়েছে, যা কিছুটা বিভ্রান্তিকর।
253253

254-
Move the `Profile` component to its own `Profile.js`, and then change the `App` component to render both `<Profile />` and `<Gallery />` one after another.
254+
`Profile` কম্পোনেন্ট কে এর নিজস্ব `Profile.js` ফাইলে সরিয়ে নিন, এবং `App` কম্পোনেন্ট কে পরিবর্তন করে `<Profile />` এবং `<Gallery />` উভয়ই একটির পর অন্যটি রেন্ডার করুন।
255255

256-
You may use either a default or a named export for `Profile`, but make sure that you use the corresponding import syntax in both `App.js` and `Gallery.js`! You can refer to the table from the deep dive above:
256+
`Profile` কম্পোনেন্টটির জন্য আপনার ইচ্ছামত ডিফল্ট অথবা নেমড এক্সপোর্ট ব্যবহার করতে পারেন, কিন্তু নিশ্চিত হউন যে আপনি `App.js` এবং `Gallery.js` উভয় ফাইলেই সঠিক ইম্পোর্ট সিনট্যাক্স ব্যবহার করছেন। আপনি ডিপ ডাইভ থেকে নিচের টেবিলটি দেখতে পারেনঃ
257257

258-
| Syntax | Export statement | Import statement |
258+
| সিনট্যাক্স | এক্সপোর্ট স্টেটমেন্ট | ইম্পোর্ট স্টেটমেন্ট |
259259
| ----------- | ----------- | ----------- |
260-
| Default | `export default function Button() {}` | `import Button from './Button.js';` |
261-
| Named | `export function Button() {}` | `import { Button } from './Button.js';` |
260+
| ডিফল্ট | `export default function Button() {}` | `import Button from './Button.js';` |
261+
| নেমড | `export function Button() {}` | `import { Button } from './Button.js';` |
262262

263263
<Hint>
264264

265-
Don't forget to import your components where they are called. Doesn't `Gallery` use `Profile`, too?
265+
আপনার কম্পোনেন্ট টি যেখানে ব্যবহার করা হয়েছে সেখানে সেটি ইম্পোর্ট করতে ভুলবেন না। `Gallery` ও তো `Profile` কে ব্যবহার করছে, তাই না?
266266

267267
</Hint>
268268

@@ -313,11 +313,11 @@ img { margin: 0 10px 10px 0; height: 90px; }
313313

314314
</Sandpack>
315315

316-
After you get it working with one kind of exports, make it work with the other kind.
316+
এক প্রকারের এক্সপোর্ট সঠিকভাবে কাজ করার পর অন্য প্রকারের এক্সপোর্ট ব্যাবহার করে কাজ করার চেষ্টা করুন।
317317

318318
<Solution>
319319

320-
This is the solution with named exports:
320+
নেমড এক্সপোর্ট ব্যাবহার করে সমাধানঃ
321321

322322
<Sandpack>
323323

@@ -367,7 +367,7 @@ img { margin: 0 10px 10px 0; height: 90px; }
367367

368368
</Sandpack>
369369

370-
This is the solution with default exports:
370+
ডিফল্ট এক্সপোর্ট ব্যাবহার করে সমাধানঃ
371371

372372
<Sandpack>
373373

0 commit comments

Comments
 (0)