แก้ button ใน react-native-elements ให้ใช้งานได้บน android sdk version ต่ำกว่า 21

Katanyoo Ubalee
Jul 21, 2017 · 1 min read

เวลาผมทำ app โดยใช้ react-native พวก Button หรือ List view ปกติผมก็ใช้จาก react-native-elements นี่แหละครับ ง่ายดี

แต่ทีนี้มันมีปัญหาที่ Button นิดหน่อยครับ คือมันทำให้ app ไม่สามารถรันได้ใน android sdk version ที่ต่ำกว่า 21 ซึ่งวิธีแก้ก็ตามนี้เลยครับ

ในไฟล์ node_modules/react-native-elements/src/buttons/Button.js ให้แก้โค้ดจาก

ตอนนี้แก้มือไปก่อน เดี๋ยวว่างแล้วจะ patch กลับไปที่ repository หลักของโปรเจคนะครับ

Happy Coding กันทุกคนนาจา ^^

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade