ရိုးရိုးလေး ရှင်းပြမယ်
Practice: Component & Styling Challenges ကို ရိုးရိုးလေးနားလည်မယ်
ဒီ practice set က new concept မဟုတ်ဘဲ Basic chapter ရဲ့ core component/styling/flexbox knowledge ကို hands-on task ၄ ခုနဲ့ ပြန်ကျင့်သားရအောင် ဒီဇိုင်းလုပ်ထားပါတယ်။
Problem → Why → Solution
ပြဿနာ — ဘာကြောင့် ဒီ concept လိုတာလဲ
Task 2 (grid) မှာ flexWrap: 'wrap' ကို parent View ထဲ ထည့်ရမှန်း မသိပြီး layout မထွက်ခြင်း
ဖြစ်လေ့ရှိတဲ့အမှား
Task 3 မှာ props default value (color = '#3b82f6') ကို destructuring ထဲ မထည့်ဘဲ every usage မှာ color ပေးဖို့ မေ့ခြင်း
Core Concept — အလုပ်လုပ်ပုံကိုနားလည်မယ်
Practice: Component & Styling Challenges ကို Debug build တစ်ခုတည်းဖြင့်မဆုံးဖြတ်ဘဲ release device ပေါ်တွင် startup, JS/UI frame rate, memory, network, crash recovery, permissions, signing နဲ့ store requirements ဖြင့်စစ်ပါ။ New Architecture compatibility နဲ့ dependency support ကို upgrade တိုင်းအတည်ပြုပါ။
- လိုအပ်ချက်
- စဉ်းစားပြီး implement
- စမ်းသပ်ပြီးရှင်းပြ
Practice: Component & Styling Challenges ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
အဓိက Syntax / Pattern
// Task 3 starter — make this Button reusable via props
function CustomButton({ label, onPress, color = '#3b82f6' }) {
return (
<TouchableOpacity style={[styles.button, { backgroundColor: color }]} onPress={onPress}>
<Text style={styles.buttonText}>{label}</Text>
</TouchableOpacity>
);
}
// Try: <CustomButton label="Save" color="#10b981" onPress={...} />Practice: Component & Styling Challenges ကို Debug build တစ်ခုတည်းဖြင့်မဆုံးဖြတ်ဘဲ release device ပေါ်တွင် startup, JS/UI frame rate, memory, network, crash recovery, permissions, signing နဲ့ store requirements ဖြင့်စစ်ပါ။ New Architecture compatibility နဲ့ dependency support ကို upgrade တိုင်းအတည်ပြုပါ။
Code ကို အဆင့်လိုက်ဖတ်မယ်
- လိုအပ်ချက်
// Task 3 starter — make this Button reusable via propsဒီ practice set က new concept မဟုတ်ဘဲ Basic chapter ရဲ့ core component/styling/flexbox knowledge ကို hands-on task ၄ ခုနဲ့ ပြန်ကျင့်သားရအောင် ဒီဇိုင်းလုပ်ထားပါတယ်။
- စဉ်းစားပြီး implement
<Text style={styles.buttonText}>{label}</Text>Practice: Component & Styling Challenges ကို Debug build တစ်ခုတည်းဖြင့်မဆုံးဖြတ်ဘဲ release device ပေါ်တွင် startup, JS/UI frame rate, memory, network, crash recovery, permissions, signing နဲ့ store requirements ဖြင့်စစ်ပါ။ New Architecture compatibility နဲ့ dependency support ကို upgrade တိုင်းအတည်ပြုပါ။
- စမ်းသပ်ပြီးရှင်းပြ
// Try: <CustomButton label="Save" color="#10b981" on...Practice: Component & Styling Challenges example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။
- လိုအပ်ချက်
- စဉ်းစားပြီး implement
- စမ်းသပ်ပြီးရှင်းပြ
Success
Practice: Component & Styling Challenges ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
Failure
Task 2 (grid) မှာ flexWrap: 'wrap' ကို parent View ထဲ ထည့်ရမှန်း မသိပြီး layout မထွက်ခြင်း
ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
ဒီ practice set က new concept မဟုတ်ဘဲ Basic chapter ရဲ့ core component/styling/flexbox knowledge ကို hands-on task ၄ ခုနဲ့ ပြန်ကျင့်သားရအောင် ဒီဇိုင်းလုပ်ထားပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Task ၄ ခု — (1) Profile card component ဆောက်ပါ (avatar image, name, bio, flexDirection: row ဖြင့် icon row), (2) ၃-column grid layout ဆောက်ပါ (flexWrap: 'wrap' သုံး), (3) Custom button component ဆောက်ပါ (props: label, onPress, color — reusable ဖြစ်အောင်), (4) Card list (FlatList) ဆောက်ပြီး alternate row color (index % 2 အသုံးပြု) ထည့်ပါ။
Code နမူနာ
// Task 3 starter — make this Button reusable via props
function CustomButton({ label, onPress, color = '#3b82f6' }) {
return (
<TouchableOpacity style={[styles.button, { backgroundColor: color }]} onPress={onPress}>
<Text style={styles.buttonText}>{label}</Text>
</TouchableOpacity>
);
}
// Try: <CustomButton label="Save" color="#10b981" onPress={...} />Task ၄ ခုစလုံးအတွက် component/screen ကို run-နိုင်တဲ့ code အနေနဲ့ ပြီးမြောက်မည်။၅ မိနစ် စမ်းကြည့်
Task ၄ ခုကို အစဉ်လိုက် ကိုယ်တိုင် implement လုပ်ကြည့်ပါ — code sample ကို ကြည့်ခင် ကိုယ်တိုင် စဉ်းစားကြိုးစားပါ။
သတိလေးတစ်ချက်
Task တစ်ခုစီကို ပြီးအောင်မလုပ်ခင် နောက် task ကို မကူးပါနှင့် — layout/component concept တစ်ခုချင်းစီကို solid အောင် လေ့ကျင့်မှ Project chapter ကို ပိုလွယ်ကူသွားပါလိမ့်မယ်။
Real-world usage
လက်တွေ့ Project မှာ ဘယ်လိုသုံးမလဲ
Practice: Component & Styling Challenges example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။
Mini challenge
ကိုယ်တိုင်တည်ဆောက်ကြည့်ပါ
Practice: Component & Styling Challenges example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။
- Example ကို copy မလုပ်ဘဲ ပြန်ရေးပါ
- Normal input နဲ့ edge case စမ်းပါ
- Run မလုပ်မီ compiler/output result ကိုခန့်မှန်းပါ
// Task 3 starter — make this Button reusable via props
function CustomButton({ label, onPress, color = '#3b82f6' }) {
return (
<TouchableOpacity style={[styles.button, { backgroundColor: color }]} onPress={onPress}>
<Text style={styles.buttonText}>{label}</Text>
</TouchableOpacity>
);
}
// Try: <CustomButton label="Save" color="#10b981" onPress={...} />ရလဒ်: Practice: Component & Styling Challenges ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
အရိပ်အမြွက် ကြည့်ရန်
Practice: Component & Styling Challenges example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။
Quick Quiz 1 / 3
Quick Quiz 2 / 3
Quick Quiz 3 / 3
ဒီသင်ခန်းစာမှာ မှတ်ထားရမယ့်အချက်များ
- လိုအပ်ချက် → စဉ်းစားပြီး implement → စမ်းသပ်ပြီးရှင်းပြ
- Practice: Component & Styling Challenges ကို Debug build တစ်ခုတည်းဖြင့်မဆုံးဖြတ်ဘဲ release device ပေါ်တွင် startup, JS/UI frame rate, memory, network, crash recovery, permissions, signing နဲ့ store requirements ဖြင့်စစ်ပါ။ New Architecture compatibility နဲ့ dependency support ကို upgrade တိုင်းအတည်ပြုပါ။
- Task 2 (grid) မှာ flexWrap: 'wrap' ကို parent View ထဲ ထည့်ရမှန်း မသိပြီး layout မထွက်ခြင်း
- Practice: Component & Styling Challenges example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။
React Native Documentation — React Native