Skip to content
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/content/learn/javascript-in-jsx-with-curly-braces.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ JSX lets you write HTML-like markup inside a JavaScript file, keeping rendering

</YouWillLearn>

## Passing strings with quotes {/*passing-strings-with-quotes*/}
## quotes এর সাথে strings পাসিং {/*passing-strings-with-quotes*/}

When you want to pass a string attribute to JSX, you put it in single or double quotes:
আপনি যখন JSX-এ একটি স্ট্রিং attribute পাস করতে চান, আপনাকে এটি single বা double quotes রাখতে হবে:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You used strings and স্ট্রিং both. I would pick স্ট্রিং for both here.


<Sandpack>

Expand All @@ -41,9 +41,9 @@ export default function Avatar() {

</Sandpack>

Here, `"https://i.imgur.com/7vQD0fPs.jpg"` and `"Gregorio Y. Zara"` are being passed as strings.
এখানে, `"https://i.imgur.com/7vQD0fPs.jpg"` এবং `"Gregorio Y. Zara"` স্ট্রিং হিসেবে পাস করা হয়েছে ।

But what if you want to dynamically specify the `src` or `alt` text? You could **use a value from JavaScript by replacing `"` and `"` with `{` and `}`**:
কিন্তু যদি আপনি dynamic ভাবে `src` বা `alt` টেক্সট নির্দিষ্ট করতে চান? আপনি **জাভাস্ক্রিপ্ট থেকে একটি value ব্যবহার করে `"` and `"` কে `{` and `}`** দিয়ে পরিবর্তন করতে পারেন:

<Sandpack>

Expand All @@ -67,11 +67,11 @@ export default function Avatar() {

</Sandpack>

Notice the difference between `className="avatar"`, which specifies an `"avatar"` CSS class name that makes the image round, and `src={avatar}` that reads the value of the JavaScript variable called `avatar`. That's because curly braces let you work with JavaScript right there in your markup!
`className="avatar"` এর মধ্যে পার্থক্য লক্ষ্য করুন, যা একটি `"avatar"` CSS ক্লাসের নাম নির্দিষ্ট করে যা ইমেজটিকে গোলাকার করে, এবং `src={avatar}` যেটি `avatar` নামে জাভাস্ক্রিপ্ট ভেরিয়েবলের value পড়ে। কারণ curly braces আপনাকে আপনার মার্কআপে জাভাস্ক্রিপ্টের সাথে কাজ করতে দেয়!
Copy link

@sudiptob2 sudiptob2 May 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`className="avatar"` এর মধ্যে পার্থক্য লক্ষ্য করুন, যা একটি `"avatar"` CSS ক্লাসের নাম নির্দিষ্ট করে যা ইমেজটিকে গোলাকার করে, এবং `src={avatar}` যেটি `avatar` নামে জাভাস্ক্রিপ্ট ভেরিয়েবলের value পড়ে। কারণ curly braces আপনাকে আপনার মার্কআপে জাভাস্ক্রিপ্টের সাথে কাজ করতে দেয়!
`className="avatar"` এবং `src={avatar}` এর মধ্যে পার্থক্য লক্ষ্য করুন`className="avatar"` একটি `"avatar"` নামের CSS ক্লাসকে নির্দিষ্ট করে ও ইমেজকে গোলাকার করে অপরদিকে, `src={avatar}`, `avatar` নামের জাভাস্ক্রিপ্ট ভেরিয়েবলের value পড়ে। এর কারণ হচ্ছে, কারলি ব্রেসেস আপনাকে আপনার মার্কআপ এর ভিতরেই জাভাস্ক্রিপ্ট এর কাজ করতে দেয়!


## Using curly braces: A window into the JavaScript world {/*using-curly-braces-a-window-into-the-javascript-world*/}
## Curly braces ব্যবহার: জাভাস্ক্রিপ্ট জগতের একটি window {/*using-curly-braces-a-window-into-the-javascript-world*/}

JSX is a special way of writing JavaScript. That means it’s possible to use JavaScript inside it—with curly braces `{ }`. The example below first declares a name for the scientist, `name`, then embeds it with curly braces inside the `<h1>`:
JSX জাভাস্ক্রিপ্ট লেখার একটি বিশেষ উপায়। তার মানে এর ভিতরে জাভাস্ক্রিপ্ট ব্যবহার করা সম্ভব— curly braces `{ }` দিয়ে। নীচের উদাহরণটিতে প্রথমে বিজ্ঞানীর জন্য একটি নাম ঘোষণা করা হয়েছে, নাম, তারপর এটিকে `<h1>` এর ভিতরে curly braces দিয়ে embeds করা হয়েছে:

<Sandpack>

Expand Down