တုံ့ပြန် ကျူတိုရီရယ်

React Home React Intro React စတင်လိုက်ပါ။ ES6 ကို တုံ့ပြန်ပါ။ Render HTML ကို တုံ့ပြန်ပါ။ JSX ကို တုံ့ပြန်ပါ။ အစိတ်အပိုင်းများကို တုံ့ပြန်ပါ။ React Class React Props အဖြစ်အပျက်များကို တုံ့ပြန်ပါ။ အခြေအနေများကို တုံ့ပြန်ပါ။ တုံ့ပြန်မှုစာရင်းများ တုံ့ပြန်မှုပုံစံများ Router ကို တုံ့ပြန်ပါ။ တုံ့ပြန်မှတ်စု CSS Styling ကို တုံ့ပြန်ပါ။ Sass Styling ကို တုံ့ပြန်ပါ။

React Hooks

Hook ဆိုတာဘာလဲ။ ပြည်နယ်ကိုအသုံးပြုပါ။ အသုံးပြုမှုအကျိုးသက်ရောက်မှု အသုံးအနှုန်း အသုံးပြုရန် Ref Reducer ကိုအသုံးပြုပါ။ ဖုန်းခေါ်ဆိုမှုကို အသုံးပြုပါ။ Memo ကိုအသုံးပြုပါ။ စိတ်ကြိုက်ချိတ်

တုံ့ပြန်လေ့ကျင့်မှုများ

တုံ့ပြန်မေးခွန်း တုံ့ပြန်လေ့ကျင့်မှုများ တုံ့ပြန်လက်မှတ်

အခြေအနေအလိုက် တင်ဆက်မှုကို တုံ့ပြန်ပါ။


React တွင်၊ သင်သည် အစိတ်အပိုင်းများကို အခြေအနေအရ တင်ဆက်နိုင်သည်။

ဒီလိုလုပ်ဖို့ နည်းလမ်းများစွာရှိပါတယ်။


ifထုတ်ပြန်ချက်

ifမည်သည့်အစိတ်အပိုင်းကို တင်ဆက်ရမည်ကို ဆုံးဖြတ်ရန် JavaScript အော်ပရေတာကို ကျွန်ုပ်တို့ အသုံးပြုနိုင်ပါသည် ။

ဥပမာ-

ဤအစိတ်အပိုင်းနှစ်ခုကို ကျွန်ုပ်တို့ အသုံးပြုပါမည်-

function MissedGoal() {
  return <h1>MISSED!</h1>;
}

function MadeGoal() {
  return <h1>Goal!</h1>;
}

ဥပမာ-

ယခု၊ ကျွန်ုပ်တို့သည် အခြေအနေတစ်ခုအပေါ် အခြေခံ၍ တင်ဆက်ရန် မည်သည့်အစိတ်အပိုင်းကို ရွေးချယ်သည့် အခြားအစိတ်အပိုင်းကို ဖန်တီးပါမည်-

function Goal(props) {
  const isGoal = props.isGoal;
  if (isGoal) {
    return <MadeGoal/>;
  }
  return <MissedGoal/>;
}

ReactDOM.render(
  <Goal isGoal={false} />,
  document.getElementById('root')
);

isGoalရည်ညွှန်းချက်ကို ပြောင်းကြည့်ပါ true-

ဥပမာ-

ReactDOM.render(
  <Goal isGoal={true} />,
  document.getElementById('root')
);


w3schools CERTIFIED . 2022

လက်မှတ်ရယူပါ။

React modules များကိုဖြည့်ပါ၊ လေ့ကျင့်ခန်းများလုပ်ပါ၊ စာမေးပွဲကိုဖြေဆိုပြီး w3schools မှအသိအမှတ်ပြုခံရပါ။

$95 စာရင်းသွင်းပါ။

Logical &&Operator

React အစိတ်အပိုင်းတစ်ခုကို သတ်မှတ်ချက်အတိုင်း ပြန်ဆိုရန် နောက်တစ်နည်းမှာ &&အော်ပရေတာကို အသုံးပြုခြင်းဖြစ်သည်။

ဥပမာ-

curly braces များကိုအသုံးပြုခြင်းဖြင့် JSX တွင် JavaScript အသုံးအနှုန်းများကို မြှုပ်နှံနိုင်သည်-

function Garage(props) {
  const cars = props.cars;
  return (
    <>
      <h1>Garage</h1>
      {cars.length > 0 &&
        <h2>
          You have {cars.length} cars in your garage.
        </h2>
      }
    </>
  );
}

const cars = ['Ford', 'BMW', 'Audi'];
ReactDOM.render(
  <Garage cars={cars} />,
  document.getElementById('root')
);

အမှန်နှင့် ညီမျှ ပါ cars.length က၊ နောက်မှ စကားရပ်သည် ပြန်ဆို &&ပါမည်။

carsarray ကို ရှင်းထုတ်ကြည့်ပါ ။

ဥပမာ-

const cars = [];
ReactDOM.render(
  <Garage cars={cars} />,
  document.getElementById('root')
);


Ternary အော်ပရေတာ

အစိတ်အပိုင်းများကို သတ်မှတ်ချက်အတိုင်း render လုပ်ရန် အခြားသောနည်းလမ်းမှာ ternary operator ကိုအသုံးပြုခြင်းဖြင့်ဖြစ်သည်။

condition ? true : false

ဂိုးနမူနာသို့ ပြန်သွားပါမည်။

ဥပမာ-

အကယ်၍ ဖြစ်ပါက MadeGoalအစိတ်အပိုင်း ကို ပြန်ပေးပါ ၊ သို့မဟုတ် ပါက အစိတ်အပိုင်းကို ပြန်ပေးပါ isGoaltrueMissedGoal

function Goal(props) {
  const isGoal = props.isGoal;
  return (
    <>
      { isGoal ? <MadeGoal/> : <MissedGoal/> }
    </>
  );
}

ReactDOM.render(
  <Goal isGoal={false} />,
  document.getElementById('root')
);

ပိုမိုလေ့လာရန်၊ ternary operator ကဏ္ဍကို ကြည့်ပါ။


လေ့ကျင့်ခန်းများဖြင့် သင့်ကိုယ်သင် စမ်းသပ်ပါ။

လေ့ကျင့်ခန်း

အောက်ပါ အစိတ်အပိုင်းကို အပြီးသတ်ရန် မှန်ကန်သော ယုတ္တိအော်ပရေတာကို အသုံးပြုပါ။

function App({isLoggedIn}) {
  return (
    <>
      <h1>My Application</h1>
      {isLoggedIn  <Profile /> }
    </>
  );
}

ReactDOM.render(<App />, document.getElementById('root'));