<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kitti Pariyaakkarakul on Medium]]></title>
        <description><![CDATA[Stories by Kitti Pariyaakkarakul on Medium]]></description>
        <link>https://medium.com/@zondezatera?source=rss-21e95a48dc04------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bxhDrDSVrlLajNc39M4hwg.jpeg</url>
            <title>Stories by Kitti Pariyaakkarakul on Medium</title>
            <link>https://medium.com/@zondezatera?source=rss-21e95a48dc04------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 02:52:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zondezatera/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[7 ข้อแนะนำเบื้องต้น ในการเขียน React Naive]]></title>
            <link>https://medium.com/@zondezatera/7-%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B9%81%E0%B8%99%E0%B8%B0%E0%B8%99%E0%B8%B3%E0%B9%80%E0%B8%9A%E0%B8%B7%E0%B9%89%E0%B8%AD%E0%B8%87%E0%B8%95%E0%B9%89%E0%B8%99-%E0%B9%83%E0%B8%99%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99-react-naive-aa822c094d28?source=rss-21e95a48dc04------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa822c094d28</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kitti Pariyaakkarakul]]></dc:creator>
            <pubDate>Wed, 23 May 2018 18:20:47 GMT</pubDate>
            <atom:updated>2018-05-23T18:20:47.714Z</atom:updated>
            <content:encoded><![CDATA[<p>ในการสร้าง Application สักตัว ณ ปัจจุบันมีหลายทางเลือกในการที่ทำให้เกิดขึ้นได้จริง ซึ่งส่วนมากจะอยู่บน Language หรือ Framework อย่าง Swift, Kotlin, Xamarin(C#) หรืออื่นๆ แต่สำหรับคนที่มาทาง web developer มาก่อน ส่วนใหญ่น่าจะคุ้นชินกับ Html, CSS, Javascript โดยพื้นฐาน ซึ่งในที่นี้ผมจะแนะนำ Framework สำหรับ สร้าง Application โดย Javacript อย่าง React Native โดยจะมี 7 หัวข้อคร่าวๆที่ผมจะแนะนำในการสร้าง Application</p><h3>LifeCycle — React 16.3 +</h3><p>เริ่มแรกเลย เราจำเป็นต้องรู้เกี่ยวกับการทำงานของ React สำหรับเวอร์ชั่น 16.3 ขึ้นไปก่อนว่ามันทำงานยังไง จะต้อง fetch api ในช่วงไหน หรือจะ render ยังไงบ้าง หรือ จะควร mount data ขั้นตอนไหนบ้างใน <a href="https://reactjs.org/docs/react-component.html">Lifecycle</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmwIOB3oxG_xviW4xS4Ebw.jpeg" /><figcaption><a href="https://twitter.com/dan_abramov/status/981712092611989509">https://twitter.com/dan_abramov/status/981712092611989509</a></figcaption></figure><h3>StyleSheet and Mobile UI</h3><p>การปรับแต่ง Style ของ Application ใน React Native นั้น เราสามารถที่จะใช้ความรู้เกี่ยวกับ CSS มาใช้งานได้ใกล้เคียงกับ syntax ที่ใช้งานกับ website ปกติ เช่น ถ้าต้องการปรับตัว text สักตัวให้หนา และ สีแดง</p><pre>// Website (CSS)<br>text-style: {<br> color: &#39;red&#39;;<br> font-weight: &#39;bold&#39;;<br>}<br>// React Naive<br>text-style: {<br> color: &#39;red&#39;,<br> fontWeight: &#39;bold&#39;<br>}</pre><p>และถ้าปกติหากขึ้นโครงสร้างโดย UI Framework อย่าง <a href="https://getbootstrap.com/">Bootstrap</a> แล้ว ใน React Native ก็จะมีให้เลือกใช้งานเช่นกันอย่าง <a href="https://mobile.ant.design/">Ant Design Mobile</a>, <a href="https://react-native-training.github.io/react-native-elements">React Native Elements</a>, <a href="https://nativebase.io/">NativeBase</a>, <a href="http://react-native-material-design.github.io/">React Native Material Design</a></p><h3>JavaScript Style Guide</h3><p>สำหรับการสร้าง Application สิ่งขาดไม่ได้คือ การกำหนดสไตล์การเขียนโค้ดเพื่อความเป็นระเบียบ อ่านง่าย และเหมาะสำหรับ maintenance ในระยะยาว ยิ่งในโปรเจ็คนั้นมี developer มากกว่า 1 คนในการ development จึงจำเป็นอย่างยิ่งที่ต้องมีสำหรับ JavaScript จะมีสไตล์การเขียนที่เป็นมาตราฐานที่คนส่วนใหญ่ยอมรับ อาทิเช่น <a href="https://github.com/airbnb/javascript">Airbnb</a>, <a href="https://google.github.io/styleguide/jsguide.html">Google</a>, <a href="https://github.com/rwaldron/idiomatic.js">Idiomatic</a>, <a href="https://github.com/standard/standard">Standard</a> โดยเราจะสามารถเช็คได้ผ่าน <a href="https://eslint.org/">Eslint</a></p><h3>Folder Structure</h3><p>อาจจะกล่าวได้ว่า การวางโครงสร้างนั้นเป็นหัวใจหลักของการ maintenance โปรเจ็คในระยะยาวหรือย่อเวลาในการเพิ่ม feature ใหม่ๆ ก็ว่าได้ หากว่าโครงสร้างไม่ดี หรือ วางโครงที่ไม่เหมาะสมกับขนาดของโปรเจ็ค ถ้ามีการแก้ไขหรือปรับปรุงจะเสียเวลาในการ refactor code อยู่เป็นนิจ ดังนั้น ผมจึงจะอยากเสนอแนวคิดว่าในการวางโครง โดยอ้างอิงจากให้ทำทุกอย่างให้เป็น Component และ Scenes ไปเพื่อให้ง่ายสำหรับจัดการและเปลี่ยนแปลงได้ง่าย</p><pre>/src<br> /common<br> /components <br>    index.js<br>    /dashboard<br>      /index.js<br>      /dashboardContainer.js<br>      /dashboardAction.js<br>      /dashboardReducer.js<br> /scenes<br>   /dashboard<br>    /dashboardScene.js<br>    /index.js<br>   /index.js<br> /utils<br>/index.js</pre><h3>Form</h3><p>หากต้องการสร้างแบบฟอร์มสำหรับต้องการให้ user กรอกข้อมูลต่างๆใน application แล้วในตามปกติ เราสามารถที่จะ handle validate ในส่วนของ form ผ่าน state เพื่อเช็คความถูกต้องได้ แต่หากถ้ามีจำนวนแบบฟอร์มที่เยอะหรือซับซ้อนแล้วมันเป็นยากที่เราจะสามารถ handle ได้หมดอย่างง่ายดาย หรืออาจจะเสียเวลาในการ maintenance มากเกินไป ดังนั้นจึงขอแนะนำ <a href="https://github.com/erikras/redux-form">Redux Form</a> หรือ <a href="https://github.com/gcanti/tcomb-form-native">Tcomb Form Native</a> ในการลดเวลาและเป็นมาตรฐานเดียวกันเวลาแก้ไขเปลี่ยนแปลง</p><h3>Router</h3><p>หากเป็น Application ใหญ่ๆ ที่มี flow ที่ซับซ้อนและหลายหน้า จะขาดไม่ได้เลยในส่วนของการจัดการเส้นทางที่ต้องการที่ต้องการให้ user ได้ไหลไปและรวมถึงส่วนของ drawer และ tab bars ด้วยที่จำเป็นสำหรับ mobile application ดังนั้นหากต้องการจัดการเองสามารถกระทำแต่มันอาจจะแลกมาด้วยความปวดเศียรเวียนเกล้าไม่น้อยเลยรวมถึง maintenance ยากมาก ดังนั้นจึงมีตัวช่วยจัดการอย่าง <a href="https://github.com/wix/react-native-navigation">React Native Navigation</a>, <a href="https://github.com/aksonov/react-native-router-flux">React Native Router Flux</a>, <a href="https://github.com/react-navigation/react-navigation">React Navigation</a> เพื่อแก้ปัญหานี้</p><h3>Basic Knowledge About Mobile Application</h3><p>หากต้องการ deploy ขึ้น store ต่างๆ หรือเพิ่ม library พิเศษที่เกี่ยวข้องกับ native ในฝั่งของ iOS หรือ Android จำเป็นต้องรู้เกี่ยวกับความรู้พื้นฐานว่าต้องรู้ config ยังไงได้บ้างหรือหาปัญหาได้ว่าเกิดจากส่วนไหนได้ อาทิเช่น หากต้องการให้มี feature สำหรับตรวจจับใบหน้า หรือ บาร์โค๊ด ในที่นี้สามารถที่ เพิ่ม library <a href="https://github.com/react-native-community/react-native-camera">react-native-camera</a> เพื่อช่วยลดเวลาลงได้ แต่หากเกิดปัญหาขึ้น เราจำเป็นต้อง manual install ในการแก้ไขไฟล์ MainApplication.java สำหรับเพิ่ม library สำหรับ Android หรือ ใช้งาน <a href="https://cocoapods.org/">CocoaPods </a>สำหรับ iOS แทนที่สามารถใช้ react-native link ชิลๆได้</p><blockquote>สุดท้ายนี้ อยากจะแนะนำว่า React Naive นั้นเป็นเพียง Framework ตัวหนึ่ง มิใช่ทุกอย่าง ฉะนั้น จงตีโจทย์ให้ดีว่าโปรเจ็คของเราเหมาะสมที่จะใช้ React Native หรือไม่</blockquote><p>ปล.เขียน blog จริงๆจังๆครั้งแรก อาจจะ งงๆ หรือมึนๆ หน่อยนะครับ :D</p><p><em>อ้างอิง :</em><br><a href="https://medium.com/@ste.grider/component-kits-for-react-native-84eff4b321b9"><em>https://medium.com/@ste.grider/component-kits-for-react-native-84eff4b321b9</em></a><em><br></em><a href="https://medium.com/@alexmngn/how-to-better-organize-your-react-applications-2fd3ea1920f1"><em>https://medium.com/@alexmngn/how-to-better-organize-your-react-applications-2fd3ea1920f1</em></a><em><br></em><a href="http://www.somkiat.cc/native-and-hybrid-app/"><em>http://www.somkiat.cc/native-and-hybrid-app/</em></a><em><br></em><a href="https://reactjs.org/docs/react-component.html"><em>https://reactjs.org/docs/react-component.html</em></a><em><br></em><a href="https://codeburst.io/5-javascript-style-guides-including-airbnb-github-google-88cbc6b2b7aa"><em>https://codeburst.io/5-javascript-style-guides-including-airbnb-github-google-88cbc6b2b7aa</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa822c094d28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LifeCycle สำหรับ React 16.3 ขึ้นไป]]></title>
            <link>https://medium.com/@zondezatera/lifecycle-%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A-react-16-3-%E0%B8%82%E0%B8%B6%E0%B9%89%E0%B8%99%E0%B9%84%E0%B8%9B-6fba8c93e22d?source=rss-21e95a48dc04------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fba8c93e22d</guid>
            <dc:creator><![CDATA[Kitti Pariyaakkarakul]]></dc:creator>
            <pubDate>Fri, 18 May 2018 09:15:29 GMT</pubDate>
            <atom:updated>2018-05-18T09:15:29.668Z</atom:updated>
            <content:encoded><![CDATA[<p>สำหรับ React 16.3 ขั้นไป นั้นจะมีการเปลี่ยนแปลง API บางตัว หรือยกเลิกใน LifeCycle ใน React 17 เช่น componentWillMount , componentWillReceiveProps , componentWillUpdate โดยทั้งหมดนั้นยังสามารถจะใช้ได้แต่จะถูกเปลี่ยนชื่อโดยการเติม prefix อย่าง UNSAFE_ ไว้ใน 16.3 อย่างไรก็ตาม เราควรจะเลี่ยงการใช้งาน หากจำเป็นต้องใช้งานจริงๆ ควรที่จะใช้ API ตัวใหม่ที่มาแทนที่</p><h4>componentWillMount</h4><p>ควรใช้ส่วนของ constructor แทนเมื่อต้องการ initialize ค่าของ component นั้น ก่อนที่จะ mount</p><h4><strong>componentWillReceiveProps</strong></h4><p>ควรใช้ getDerivedStateFromProps แทนในกรณีต้องการปรับ state ใหม่ ใน component หรือ เลี่ยงมาใช้ componentDidUpdate ในกรณี ต้องการ side-effect ในการ fetch data ต่างๆ</p><h4>componentWillUpdate</h4><p>componentWillUpdate ควรใช้ getDerivedStateFromProps แทนในกรณีต้องการปรับ state ใหม่ ใน component</p><h4>ภาพสรุป LifeCycle ใน React 16.3 ขึ้นไป</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmwIOB3oxG_xviW4xS4Ebw.jpeg" /><figcaption><a href="https://twitter.com/dan_abramov/status/981712092611989509">https://twitter.com/dan_abramov/status/981712092611989509</a></figcaption></figure><p><em>อ้างอิง : </em><a href="https://hackernoon.com/problematic-react-lifecycle-methods-are-going-away-in-react-17-4216acc7d58b"><em><br>https://hackernoon.com/problematic-react-lifecycle-methods-are-going-away-in-react-17-4216acc7d58b</em></a><em><br></em><a href="https://reactjs.org/docs/react-component.html"><em>https://reactjs.org/docs/react-component.html</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fba8c93e22d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>