<?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 SASOM on Medium]]></title>
        <description><![CDATA[Stories by SASOM on Medium]]></description>
        <link>https://medium.com/@vtn.dev2016?source=rss-7062a4f76bde------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LJawZJNxMsj4XaJ4W9tHzw.png</url>
            <title>Stories by SASOM on Medium</title>
            <link>https://medium.com/@vtn.dev2016?source=rss-7062a4f76bde------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 00:39:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vtn.dev2016/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[สะสม (Sasom) ระบบสะสมแต้ม ระบบสะสมคะแนน ด้วยเทคโนโลยี Blockchain, Token, NFTs]]></title>
            <link>https://medium.com/sasom-app/%E0%B8%AA%E0%B8%B0%E0%B8%AA%E0%B8%A1-sasom-%E0%B8%A3%E0%B8%B0%E0%B8%9A%E0%B8%9A%E0%B8%AA%E0%B8%B0%E0%B8%AA%E0%B8%A1%E0%B9%81%E0%B8%95%E0%B9%89%E0%B8%A1-%E0%B8%A3%E0%B8%B0%E0%B8%9A%E0%B8%9A%E0%B8%AA%E0%B8%B0%E0%B8%AA%E0%B8%A1%E0%B8%84%E0%B8%B0%E0%B9%81%E0%B8%99%E0%B8%99-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2%E0%B9%80%E0%B8%97%E0%B8%84%E0%B9%82%E0%B8%99%E0%B9%82%E0%B8%A5%E0%B8%A2%E0%B8%B5-blockchain-token-nfts-482b643d0828?source=rss-7062a4f76bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/482b643d0828</guid>
            <category><![CDATA[royalty-programs]]></category>
            <category><![CDATA[crm-software]]></category>
            <category><![CDATA[rewards-programs]]></category>
            <category><![CDATA[cryptocurrency-news]]></category>
            <category><![CDATA[nft]]></category>
            <dc:creator><![CDATA[SASOM]]></dc:creator>
            <pubDate>Thu, 20 Oct 2022 04:05:24 GMT</pubDate>
            <atom:updated>2022-10-20T09:16:45.981Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jyByAvttdTyorWaS.png" /></figure><blockquote><em>ก้าวล้ำไปอีกขั้นกับ</em><strong><em>ระบบสะสมแต้ม ระบบสะสมคะแนน ด้วยเทคโนโลยี Blockchain, Token, NFTs</em></strong><em> เจ้าแรกและเจ้าเดียวในไทยที่มีฟีเจอร์ครบใช้งานง่าย ช่วยสร้างความแตกต่างในการทำการตลาด การเก็บข้อมูลลูกค้า การสร้างคอมมูนิตี้ ที่จะช่วยกระตุ้นยอดขาย ช่วยเปลี่ยนลูกค้าขาจรให้เป็นลูกค้าประจำ และที่สำคัญใช้งานง่าย สะดวก แค่มีสมาร์ทโฟนเครื่องเดียวก็ใช้งานได้ทันที!</em></blockquote><p>ในปัจจุบันปฎิเสธไม่ได้เลยว่าระบบสะสมแต้มมีความสำคัญต่อธุรกิจอย่างมาก แบรนด์ใหญ่ ๆ ใช้ทุนมหาศาลถึง 7 หลักในการพัฒนาระบบ CRM หรือ ระบบสะสมแต้มขึ้นมาเพื่อรักษาฐานลูกค้าให้คงอยู่กับแบรนด์ไปนาน ๆ และระบบสะสมดีอย่างไร แตกต่างอย่างไร เดี๋ยวเรามาดูกัน</p><p>หลายคนอาจจะมีคำถามว่าแล้วการสะสมแต้มในรูปแบบทั่ว ๆ ไปมันดียังไงนะ ทำไมถึงต้องลงทุนด้วย และทำไมถึงต้องเป็น Blockchain, Token, NFTs ?</p><h4>มาลองดูข้อดีของระบบสะสมแต้มโดยทั่วไปกันดีกว่า</h4><p>โดยปกติแล้วระบบสะสมแต้มจะมีข้อดีดังนี้</p><h4><strong>1. รักษาฐานลูกค้า</strong></h4><p>แน่นอนว่าการทำธุรกิจสิ่งที่ขาดไม่ได้เลยคือการหาลูกค้าใหม่อย่างสม่ำเสมอ และเมื่อมีลูกค้าเข้ามาซื้อสินค้าหรือบริการ สิ่งที่สำคัญมากๆ ถัดมาคือการเปลี่ยนลูกค้าเหล่านั้นให้เป็นลูกค้าประจำ เพราะธุรกิจที่ยั่งยืนคือธุรกิจที่มีลูกค้าประจำเป็นจำนวนมาก เพราะลูกค้าประจำจะช่วยให้ธุรกิจสร้างกระแสเงินสดได้ดีกว่าการหาลูกค้าใหม่อยู่ตลอดเวลา เนื่องจากการหาลูกค้าใหม่ต้องแลกมากับค่าใช้จ่ายในการทำการตลาด ซึ่งจะทำให้เจ้าของธุรกิจรู้สึกเหนื่อย การสร้างแรงจูงใจโดยให้ลูกค้าสะสมแต้มเพื่อแลกของรางวัลหรือสิทธิพิเศษ จึงเป็นหนึ่งวิธีที่จะรักษาฐานลูกค้าให้คงอยู่กับเราไปนาน ๆ</p><h4>2. ช่วยกระตุ้นยอดขาย</h4><p>ลองนึกภาพตามนะครับถ้าสมุมติลูกค้ามีการสะสมแต้มได้ครึ่งทางแล้ว เหลืออีกแค่ครึ่งทางอาจจะได้รับของรางวัลพิเศษ หรือ สิ่งจูงใจอะไรบางอย่าง ถ้าลูกค้าจะเปลี่ยนไปใช้บริการหรือไปซื้อสินค้ากับร้านอื่นจะทำให้ลูกค้ามีความรู้สึกเสียดาย เพราะว่าถ้าลูกค้ากลับมาซื้อซ้ำและสะสมแต้มต่ออีกครึ่งทางก็จะได้รับของรางวัลที่เขาต้องการ</p><p>ซึ่งสิ่งนี้แหละที่จะทำให้ลูกค้าตัดสินใจกลับมาซื้อซ้ำได้ง่ายขึ้น และเราก็สร้างความประทับใจให้ลูกค้าต่อได้อีก</p><p>เราสามารถจัดโปรโมชั่นดึงดูดลูกค้าเพิ่มเติมเป็นช่วง ๆ ได้ เช่น ถ้าลูกค้ามาใช้บริการหรือซื้อสินค้าทุกเย็นวันศุกร์ช่วงเวลา 15.00–19.00 จะได้รับแต้มเพิ่มเป็นสองเท่า ยิ่งจะทำให้ลูกค้าอยากติดตามและซื้อสินค้ากับแบรนด์ของเรามากขึ้น</p><h4>3. นำสินค้าที่ขายไม่ออกมาจัดโปรโมชั่นโดยใช้แต้มแลก</h4><p>เคยไหมของค้างสต๊อคขายไม่ออก แก้ไขปัญหาได้ง่าย ๆ โดยการเอาสินค้าเหล่านั้นมาผูกเงื่อนไขในการสะสมแต้มเพื่อแลกรับ วิธีนี้จะช่วยระบายสินค้าที่ขายไม่ออกได้ดีขึ้น และเป็นการกระตุ้นยอดขายไปในตัว</p><h4>4. ป้องกันให้ลูกค้าไม่ไปซื้อสินค้าหรือบริการกับแบรนด์ อื่น ๆ</h4><p>ถ้าของรางวัลในการสะสมแต้มของเราดูจูงใจกว่าร้านอื่น ๆ และมีการสร้างกลยุทธ์ หรือ การสร้างมีส่วนร่วมกับแบรนด์ที่ดี จะช่วยให้ลูกค้าอยู่กับเรานานขึ้น จุดนี้เราสามารถสร้างกลยุทธ์ที่แตกต่างได้ ซึ่งจะอยู่ที่ไอเดียของเจ้าของธุรกิจ โดยระบบสะสมแต้มแลกของรางวัลจะเป็นเพียงเครื่องมือในการสนับสนุนในการจัดโปรโมชั่น หรือ การจัดกิจกรรมเป็นไปได้ง่ายขึ้น</p><h4>5. รู้ข้อมูลลูกค้าจะทำให้แยกกลุ่มลูกค้าและสร้างกลยุทธ์ได้ตรงจุด</h4><p>การที่เรามีระบบสมาชิกจะทำให้เรารู้พฤติกรรมลูกค้า และสามารถแยกกลุ่มลูกค้าได้ว่าเป็น ลูกค้าขาจร, ลูกค้าประจำ หรือ ลูกค้าทั่วไป ซึ่งแต่ล่ะกลุ่มก็จะต่างกันออกไป ข้อมูลเหล่านี้จะทำให้เรารู้ว่าเราต้องทำอะไรต่อกับกลุ่มลูกค้าในแต่ล่ะกลุ่ม เช่น ถ้าเป็นกลุ่มลูกค้าทั่วไป เราก็อาจจะวางกลยุทธ์ในการเปลี่ยนให้พวกเขาให้เป็นลูกค้าประจำให้ได้ หรือ ถ้าเป็นลูกค้าประจำอยู่แล้วเราอาจจะมีเสนอขายสินค้าและบริการอื่น ๆ เพิ่มเติมได้ หรือแม้แต่ในกรณีที่ลูกค้า เป็นลูกค้าประจำอยู่แล้ว แต่เขาหายไป เราควรจะวางกลยุทธ์อย่างไรต่อไปเพื่อให้เขากลับมาซื้อซ้ำอีกครั้ง</p><p>ซึ่งข้อมูลลูกค้าสามารถนำไปส่งอีเมลล์, sms, หรือนำไปยิงโฆษณาตาม social media ได้ด้วยนะ</p><h4>6. สื่อสารและสร้างการมีส่วนร่วมกับลูกค้าได้ดียิ่งขึ้น</h4><p>เมื่อคุณมีข้อมูลลูกค้าเช่น เบอร์โทร, อีเมลล์, ชื่อ และ line จะทำให้คุณสื่อสารกับลูกค้าได้ตรงจุดมากขึ้น เช่น การส่งฟอร์มไปยังลูกค้าเพื่อรับ feedback เพื่อนำมาปรับปรุงให้ธุรกิจของคุณตอบโจทย์ลูกค้ามาขึ้น, การส่งข้อมูลทางด้านการตลาด หรือ การจัดกิจกรรม และการสร้างการมีส่วนร่วมกับแบรนด์ สิ่งเหล่านี้จะทำให้ลูกค้าหลงรักคุณมากขึ้น</p><p>และทั้งหมดนี้คือข้อดีของระบบสะสมแต้มที่เห็นกันตามท้องตลาด</p><blockquote><em>หลายคนสงสัยว่า อ้าวแล้ว</em><a href="https://sasom.app/"><strong><em>ระบบสะสม (SASOM)</em></strong></a><em> คือการสะสมแต้มแบบไหน? ทำไมถึงต้องใช้ Token และ NFTs กันนะ?</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WsQgaX6StAd4FrUL.png" /><figcaption>ทดลองใช้งานได้ที่ <a href="https://sasom.app/">https://sasom.app</a></figcaption></figure><blockquote><em>แบบไหนที่จะสร้างความแตกต่าง และเป็นสิ่งที่โลกกำลังหมุนไป นั่นคือสิ่งที่เรากำลังไป</em></blockquote><p>โดยปกติทั่วไปแล้ว<strong><em>ระบบสะสมแต้ม</em></strong> คือระบบที่มอบประโยชน์ให้กับร้านค้าและลูกค้าเป็นหลักตามทั้ง 6 ข้อที่ผมได้เขียนไปข้างบน (จริง ๆ จะมีข้อดีมากกว่านั้น)</p><p><strong>ระบบสะสม (SASOM) </strong>เราก็คงข้อดีเหล่านั้นไว้เหมือนระบบอื่น ๆ แต่สิ่งที่<strong>ระบบสะสม (SASOM) </strong>มีเพิ่มเติมขึ้นมาคือการนำเอา Token และ NFTs มาประยุกต์ใช้เพื่อสร้างความแตกต่าง และสอดรับกับเทรนในอนาคต ที่แบรนด์ใหญ่ ๆ กำลังทำ แต่ใช้เงินจำนวนมาก!</p><p><strong>ระบบสะสม (SASOM) </strong>เราได้เปลี่ยนแต้มที่โดยปกติแล้วจะอยู่ในรูปแบบของ Database ซึ่งข้อมูลถูกเก็บกับผู้ให้บริการ แต่ระบบสะสม แต้มของร้านค้าจะอยู่ในรูปแบบ Token ที่อยู่บน Blockchain ซึ่งจะทำให้ธุรกรรมต่าง ๆ มีความโปร่งใสและตรวจสอบได้ สามารถโอนย้ายได้ง่าย นำไปต่อยอดในระบบอื่น ๆ ได้ง่าย ซึ่งทุกร้านจะสามารถออก Token (แต้ม) เป็นของตัวเองได้เลยทันที</p><p>ระบบสะสมเราได้เปลี่ยนคูปองธรรดา ๆ ให้เป็น NFTs ซึ่งจะทำให้สามารถโอนให้เพื่อนได้ แลกเปลี่ยนกับเพื่อนได้ หรือแม้กระทั่งแปลงสภาพให้เป็นบัตรสมาชิกได้อีกด้วย</p><p>เมื่อเรามี<strong>ระบบสะสมแต้ม</strong> <strong>ระบบสะสมคะแนน</strong>ที่รองรับในเรื่องของ NFTs และ Token ทางร้านค้าหรือธุรกิจที่ใช้บริการระบบสะสมจะสามารถออกแบบแคมเปญทางด้านการตลาดทั้งในรูปแบบปกติที่คนอื่น ๆ เขาทำกัน และสร้างแคมเปญในแบบที่แปลกใหม่ไม่เหมือนใครในฝั่งของโลก Web3.0, Metaverse, NFT ได้อีกด้วย</p><p>เช่นการสะสมแต้มเพื่อแลกรับ NFTs, หรือ การเปลี่ยน Member card ให้อยู่ในรูปแบบของ NFT, การจัด Event แบบ exclusive สำหรับผู้ที่ถือ Member card ในรูปแบบ NFT, หรือแม้กระทั่งการสร้างคอมมูนิตี้ร่วมกับ NFT projects ต่าง ๆ ทั้งในและต่างประเทศ</p><blockquote><strong>หากสนใจใช้งานระบบสะสมแต้ม ให้นึกถึง</strong><a href="https://sasom.app/"><strong>สะสม</strong></a></blockquote><blockquote><em>อ่านข้อมูล</em><strong><em>ระบบสะสมแต้มของสะสม (SASOM) </em></strong><em>ได้ที่ </em><a href="https://sasom.app/"><em>https://sasom.app</em></a><em> หรือ ติดตามเราได้ที่ </em><a href="https://www.facebook.com/sasomapp">https://www.facebook.com/sasomapp</a></blockquote><p>ขอบคุณผู้สนับสนุนหลัก</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UkXKcKP_MyE7ShQA.png" /><figcaption><a href="https://www.tokenine.co/">tokenine</a>, <a href="https://techtoro.co/">techtoro</a>, <a href="https://www.jventures.co.th/">jventure</a> ,<a href="https://apptify.io/">apptify</a>, <a href="https://www.jfincoin.io/jfinchain">jfinchain</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=482b643d0828" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sasom-app/%E0%B8%AA%E0%B8%B0%E0%B8%AA%E0%B8%A1-sasom-%E0%B8%A3%E0%B8%B0%E0%B8%9A%E0%B8%9A%E0%B8%AA%E0%B8%B0%E0%B8%AA%E0%B8%A1%E0%B9%81%E0%B8%95%E0%B9%89%E0%B8%A1-%E0%B8%A3%E0%B8%B0%E0%B8%9A%E0%B8%9A%E0%B8%AA%E0%B8%B0%E0%B8%AA%E0%B8%A1%E0%B8%84%E0%B8%B0%E0%B9%81%E0%B8%99%E0%B8%99-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2%E0%B9%80%E0%B8%97%E0%B8%84%E0%B9%82%E0%B8%99%E0%B9%82%E0%B8%A5%E0%B8%A2%E0%B8%B5-blockchain-token-nfts-482b643d0828">สะสม (Sasom) ระบบสะสมแต้ม ระบบสะสมคะแนน ด้วยเทคโนโลยี Blockchain, Token, NFTs</a> was originally published in <a href="https://medium.com/sasom-app">SASOM.APP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Higher-Order Components (HOC) React คืออะไร]]></title>
            <link>https://medium.com/ubon-startup/higher-order-components-hoc-react-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-5398c754e7c6?source=rss-7062a4f76bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/5398c754e7c6</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[SASOM]]></dc:creator>
            <pubDate>Mon, 04 Dec 2017 16:05:39 GMT</pubDate>
            <atom:updated>2018-06-28T11:21:22.526Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p7Fb6uAwTDrWhrf5XCt6Fw.jpeg" /></figure><p>วันนนี้ผมจะมาแชร์คร่าว ๆว่า Higher-Order Components (HOC) คืออะไร</p><p>(HOC) เป็น advanced technique ใน react ใช้สำหรับ share logic ระหว่าง component หรือเป็นการเรียกใช้ logic แบบซ้ำๆ โดยจะเป็น function ที่ใช้ รับ parameter เป็น component และ returns ออกมาเป็น component ใหม่ ซึ่งเราจะเจอบ่อย ๆ ใน connect ของ redux</p><h4>Use</h4><p>const EnhancedComponent = higherOrderComponent(WrappedComponent);</p><p>ตัวอย่าง สมุมว่าเรามี CommentList component ที่แสดงรายการความคิดเห็น</p><pre>class CommentList extends React.Component {<br>  constructor(props) {<br>    super(props);<br>    this.handleChange = this.handleChange.bind(this);<br>    this.state = {<br>      // &quot;DataSource&quot; คือ component หรือ แหล่งข้อมูลภายนอก<br>      comments: DataSource.getComments()<br>    };<br>  }<br><br>  componentDidMount() {<br>    // เรียกใชเ addChangeListener เพื่อดูการเปลี่ยนแปลงข้อมูล<br>    DataSource.addChangeListener(this.handleChange);<br>  }<br><br>  componentWillUnmount() {<br>    // เรียกใช้ removeChangeListener เมื่อ Unmount<br>    DataSource.removeChangeListener(this.handleChange);<br>  }<br><br>  handleChange() {<br>    // อัพเดทความคิดเห็นเมื่อข้อมูลมีการเปลี่ยนแปลง<br>    this.setState({<br>      comments: DataSource.getComments()<br>    });<br>  }<br><br>  render() {<br>    return (<br>      &lt;div&gt;<br>        {this.state.comments.map((comment) =&gt; (<br>          &lt;Comment comment={comment} key={comment.id} /&gt;<br>        ))}<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><p>ซึ่งใน CommentList component มีการเรียกใช้ข้อมูลจาก DataSource component ที่เป็นตัวคอยจัดการกับ comment และ Post โดยใน CommentList component จะมีการเรียกใช้ Listener ใน DataSource เพื่อเช็คว่า comment มีการเปลี่ยนแปลงหรือไม่ ถ้ามีก็ให้ไป setState comments ใหม่เพื่อเอาไปแสดงใน view หรืออะไรก็ตามแต่</p><p>และมีอีก 1 component ที่ใช้ในการแสดง Blog post ดังนี้</p><pre>class BlogPost extends React.Component {<br>  constructor(props) {<br>    super(props);<br>    this.handleChange = this.handleChange.bind(this);<br>    this.state = {<br>      blogPost: DataSource.getBlogPost(props.id)<br>    };<br>  }<br><br>  componentDidMount() {<br>    DataSource.addChangeListener(this.handleChange);<br>  }<br><br>  componentWillUnmount() {<br>    DataSource.removeChangeListener(this.handleChange);<br>  }<br><br>  handleChange() {<br>    this.setState({<br>      blogPost: DataSource.getBlogPost(this.props.id)<br>    });<br>  }<br><br>  render() {<br>    return &lt;TextBlock text={this.state.blogPost} /&gt;;<br>  }<br>}</pre><p>จะเห็นได้ว่าทั้ง BlogPost และ CommentList มีการเรียกใช้ Method ต่างๆ ใน DataSource ที่เดียวกันแต่คลล่ะ Method และได้ผลลัพธ์ที่ต่างกัน แต่การทำงานส่วนมากมันเหมือนกันเลย ดังนี้</p><ul><li>On mount, add a change listener to DataSource.</li><li>Inside the listener, call setState whenever the data source changes.</li><li>On unmount, remove the change listener.</li></ul><p>ถึงตอนนี้คงไม่มีปัญหาอะไร แต่ถ้าโปรเจ็คเราใหญ่ขึ้นคงเป็นปัญหาแน่ๆ เพราะเราต้องคอยมากำหนด Listener และ setState ทุก ๆ component ที่ต้องการรับข้อมูลจาก DataSource เวลาแก้ก็คงลำบากเพราะงั้นจึงมี Higher-Order Components เข้ามาช่วยให้เราสามารถกำหนดตรรกะนี้ได้ในที่เดียวและแชร์กับ Components ต่างๆ ได้โดยไม่ต้องเขียนหลายรอบ</p><p>ซึ่งเราจะสามารถสร้างและใช้งานได้ดังนี้</p><pre>const CommentListWithSubscription = withSubscription(<br>  CommentList,<br>  (DataSource) =&gt; DataSource.getComments()<br>);<br><br>const BlogPostWithSubscription = withSubscription(<br>  BlogPost,<br>  (DataSource, props) =&gt; DataSource.getBlogPost(props.id)<br>);</pre><p>withSubscription คือ function ที่ return component ซึ่ง parameter แรก คือ component ที่ต้องการรับข้อมูลและ parameter ที่สอง คือดึงข้อมูลที่เราสนใจมาใช้งาน</p><p>เมื่อ CommentListWithSubscription และ BlogPostWithSubscription Render เสร็จ CommentList และ BlogPost จะถูกส่ง data props กับข้อมูลล่าสุดที่ดึงข้อมูลจาก DataSource</p><p>// This function takes a component...<br>function withSubscription(WrappedComponent, selectData) {<br> // ...and returns another component...<br> return class extends React.Component {<br> constructor(props) {<br> super(props);<br> this.handleChange = this.handleChange.bind(this);<br> this.state = {<br> data: selectData(DataSource, props)<br> };<br> }<br><br> componentDidMount() {<br> // ... that takes care of the subscription...<br> DataSource.addChangeListener(this.handleChange);<br> }<br><br> componentWillUnmount() {<br> DataSource.removeChangeListener(this.handleChange);<br> }<br><br> handleChange() {<br> this.setState({<br> data: selectData(DataSource, this.props)<br> });<br> }<br><br> render() {<br> // ... and renders the wrapped component with the fresh data!<br> // Notice that we pass through any additional props<br> return &lt;WrappedComponent data={this.state.data} {...this.props} /&gt;;<br> }<br> };<br>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5398c754e7c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubon-startup/higher-order-components-hoc-react-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-5398c754e7c6">Higher-Order Components (HOC) React คืออะไร</a> was originally published in <a href="https://medium.com/ubon-startup">Ubon Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#React native สร้างสไลด์รูปภาพ ด้วย react-native-snap-carousel]]></title>
            <link>https://medium.com/ubon-startup/react-native-%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B8%AA%E0%B9%84%E0%B8%A5%E0%B8%99%E0%B9%8C%E0%B8%A3%E0%B8%B9%E0%B8%9B%E0%B8%A0%E0%B8%B2%E0%B8%9E-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-snap-carousel-e2c70fd283d7?source=rss-7062a4f76bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c70fd283d7</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[SASOM]]></dc:creator>
            <pubDate>Tue, 07 Nov 2017 14:55:10 GMT</pubDate>
            <atom:updated>2017-11-23T03:37:28.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*YEwM4F3v5llknGGm8mA2OQ.png" /></figure><p>วันนี้ผมมาเสนอ packed react-native-snap-carousel สำหรับท่านที่กำลังมองหา packed สำหรับสร้างสไลด์รูปภาพ ใน React native ซึ่งผู้ใช้สามารถออกแบบ card เพื่อทำเป็นสไลด์ได้ สำหรับ packed นี้เรียกได้ว่าอยากสไลด์อะไรก็ออกแบบได้เลย ที่สำคัญเป็น Open-Sourcing มี ParallaxImage และ Pagination component มาให้ใช้ด้วย</p><h4>Archriss’ Showcase App สามารถดาวโหลดได้ทั้ง ios และ android</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*7j-0u1HjBtVkF0Npz4hM0w.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*k6rhWO0a2GaUX4PGpgqE7Q.gif" /></figure><p>อ้างอิง <a href="https://github.com/archriss/react-native-snap-carousel">https://github.com/archriss/react-native-snap-carousel</a></p><h3>npm install packed</h3><pre>npm install --save react-native-snap-carousel</pre><h3>Usage</h3><pre>import Carousel from &#39;react-native-snap-carousel&#39;;<br><br>export class MyCarousel extends Component {<br><br>    _renderItem ({item, index}) {<br>        return (<br>            &lt;View style={styles.slide}&gt;<br>                &lt;Text style={styles.title}&gt;{ item.title }&lt;/Text&gt;<br>            &lt;/View&gt;<br>        );<br>    }<br><br>    render () {<br>        return (<br>            &lt;Carousel<br>              ref={(c) =&gt; { this._carousel = c; }}<br>              data={this.state.entries}<br>              renderItem={this._renderItem}<br>              sliderWidth={sliderWidth}<br>              itemWidth={itemWidth}<br>            /&gt;<br>        );<br>    }<br>}</pre><h4>อธิบาย code สำหรับการใช้งานเบื้องต้น</h4><p>ขั้นตอนแรกให้ import component Carousel และทำการเรียกใช้งาน component Carousel และส่ง props ที่จำเป็นต้องใช้ไป คือ</p><ul><li>props data เป็นการส่ง data ที่เราต้องการไปแสดงผลที่ function render ที่เขียนไว้ในขั้นตอนที่ 2</li><li>props renderItem กำหนด function ที่จะเป็นตัว render</li><li>props sliderWidth กำหนดความกว้างของ slider</li><li>itemWidth กำหนดความกว้างของ item ใน slider ดูตัวอย่างตามภาพนี้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*hTgZdq6S3NTOpJ9kF3v_uw.jpeg" /></figure><p>ขั้นตอนที่สอง ทำการสร้าง function เพื่อ render หน้าตา ui ตามที่เราต้องการ ซึ่ง function ทำการ destructuring ไว้เพื่อรับ props item และ index จาก component Carousel เพื่อนำ data ไป render ตามที่เรากำหนดไว้ใน function</p><p>สำหรับ snap carousel เขามีตัวอย่าง code ให้ สามารถ clone ได้ที่ <a href="https://github.com/archriss/react-native-snap-carousel.git">https://github.com/archriss/react-native-snap-carousel.git</a> ตัวอย่างจะอยู่ folder example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*8IfRpBWB-ROf7qLcyv3fsA.gif" /></figure><p>สามารถกำหนด Style และ animation ได้ รายละเอียด Prop จะอยู่ใน doc นะครับลิ้ง <a href="https://github.com/archriss/react-native-snap-carousel">https://github.com/archriss/react-native-snap-carousel</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c70fd283d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubon-startup/react-native-%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B8%AA%E0%B9%84%E0%B8%A5%E0%B8%99%E0%B9%8C%E0%B8%A3%E0%B8%B9%E0%B8%9B%E0%B8%A0%E0%B8%B2%E0%B8%9E-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-snap-carousel-e2c70fd283d7">#React native สร้างสไลด์รูปภาพ ด้วย react-native-snap-carousel</a> was originally published in <a href="https://medium.com/ubon-startup">Ubon Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Navigation คืออะไร เริ่มต้นใช้งาน React Navigation สำหรับ React native]]></title>
            <link>https://medium.com/ubon-startup/%E0%B9%80%E0%B8%A3%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%95%E0%B9%89%E0%B8%99%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-react-navigation-%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A-react-native-a08554e4e26a?source=rss-7062a4f76bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/a08554e4e26a</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react-navigation]]></category>
            <dc:creator><![CDATA[SASOM]]></dc:creator>
            <pubDate>Thu, 02 Nov 2017 04:23:28 GMT</pubDate>
            <atom:updated>2017-11-06T12:19:46.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBeA14hJ3fjIB1yQpD3DlA.png" /></figure><p>บทความนี้เราจะมาเริ่มต้นใช้งาน React navigation สำหรับ React Native กันครับ</p><p>React navigation คือ package ที่จะเข้ามาช่วย navigate ไปยังหน้าต่าง ๆ ภายในแอพ เช่น เมื่อเปิดแอพขึ้นมาแล้วให้แสดงหน้าอะไร หรือเมื่อ user กดปุ่มแล้วให้ไปหน้าไหน โดยการทำงานจะอยู่ในรูปแบบของ Stack โดยบทความนี้เราจะมา ทดลองใช้ StackNavigator กันครับ</p><h3>Quick Start</h3><p>ขั้นตอนแรกให้ทำการติดตั้ง package react-navigation</p><h4>install with npm ( ติดตั้งโดยใช้ npm )</h4><p>npm install — save react-navigation</p><h4>install with Yarn ( ติดตั้งโดยใช้ Yarn )</h4><p>yarn add react-navigation</p><p>StackNavigator เรียกได้ว่าเป็นรูปแบบการนำทางแบบพื้นฐานที่พบมากที่สุดและเจอบ่อยที่สุดเลยก็ว่าได้</p><p>สำหรับการใช้งานสามารถดูตาม docs ของ react navigation ก็ได้ครับ แต่สำหรับบทความนี้ผมจะสรุปใน version ไทยตามความเข้าใจของผมเองนะครับ (จริง ๆ ก็ดูมาจาก docs แหละครับ 555)</p><p>รูปแบบการใช้งาน StackNavigator</p><h4>API Definition</h4><pre>StackNavigator(RouteConfigs, StackNavigatorConfig)</pre><p>RouterConfigs เป็น object ที่จะแมพชื่อเส้นทางไปยัง config เส้นทางเพื่อที่จะบอกให้ Navigator แสดง screens อะไร</p><p>StackNavigatorConfig ใช้สำหรับกำหนดค่าต่าง ๆ เช่นกำหนดส่วนหัวของแถบนำทาง, ตั้งค่า Screen เริ่มต้นและอื่น ๆ หากไม่กำหนดมันจะเป็นค่าเริ่มต้นสำหรับ ios และ android สามารถดูข้อมูลเพิ่มเติมได้ใน docs ของ react navigation</p><p>มาเริ่มทดลองใช้กันดีกว่าครับ ให้ทำการเพิ่ม key และ screens เข้าไปใน StackNavigator ซึ่งแต่ล่ะ key จะแสดงถึง screens ที่เรากำหนดไว้</p><pre>import React from &#39;react&#39;;<br>import { View, Text } from &#39;react-native&#39;;<br>import { StackNavigator } from &#39;react-navigation&#39;;<br><br>const HomeScreen = () =&gt; (<br>  &lt;View style={{ flex: 1, alignItems: &#39;center&#39;, justifyContent: &#39;center&#39; }}&gt;<br>    &lt;Text&gt;Home Screen&lt;/Text&gt;<br>  &lt;/View&gt;<br>);<br><br>const DetailsScreen = () =&gt; (<br>  &lt;View style={{ flex: 1, alignItems: &#39;center&#39;, justifyContent: &#39;center&#39; }}&gt;<br>    &lt;Text&gt;Details Screen&lt;/Text&gt;<br>  &lt;/View&gt;<br>);<br><br>const RootNavigator = StackNavigator({<br>  Home: { // กำหนดคีย์เพื่อใช้เข้าถึง screen<br>    screen: HomeScreen, // HomeScreen หรือ component ที่แสดงหน้า UI<br>      // เมื่อมันถูกโหลดเสร็จจะได้รับ navigation` prop ไปเพื่อใช้ในการนำทางไปเส้นทางอื่นๆใน Stack<br>  },<br>  Details: {<br>    screen: DetailsScreen,<br>  },<br>});<br><br>export default RootNavigator;</pre><p>เราสามารถเพิ่ม navigationOptions หรือ ตัวเลือกการนำทางที่จะใช้สำหรับ screen ที่เราต้องการได้ เช่น</p><pre>...<br><br>const RootNavigator = StackNavigator({<br>  Home: {<br>    screen: HomeScreen,<br>    navigationOptions: {<br>      headerTitle: &#39;Home&#39;, // เพิ่ม title ให้ส่วนหัวเป้นคำว่า Home<br>    },<br>  },<br>  Details: {<br>    screen: DetailsScreen,<br>    navigationOptions: { <br>      headerTitle: &#39;Details&#39;,<br>    },<br>  },<br>});<br><br>export default RootNavigator;</pre><p>สุดท้ายเป็นการทดลองเพิ่มปุ่มเข้าไปใน HomeScreen และเมื่อ User กดให้ไปหน้า DetailsScreen</p><pre>...<br>import { View, Text, Button } from &#39;react-native&#39;;<br><br>const HomeScreen = ({ navigation }) =&gt; (<br>  &lt;View style={{ flex: 1, alignItems: &#39;center&#39;, justifyContent: &#39;center&#39; }}&gt;<br>    &lt;Text&gt;Home Screen&lt;/Text&gt;<br>    &lt;Button<br>      onPress={() =&gt; navigation.navigate(&#39;Details&#39;)} <br>// เมื่อกดปุ่มจะ navigate ไป key Details ซึ่งจะแสดงหน้า DetailsScreen ออกมา<br>      title=&quot;Go to details&quot;<br>    /&gt;<br>  &lt;/View&gt;<br>);<br><br>...</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a08554e4e26a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubon-startup/%E0%B9%80%E0%B8%A3%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%95%E0%B9%89%E0%B8%99%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-react-navigation-%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A-react-native-a08554e4e26a">React Navigation คืออะไร เริ่มต้นใช้งาน React Navigation สำหรับ React native</a> was originally published in <a href="https://medium.com/ubon-startup">Ubon Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>