jaredh159 / tailwind-react-native-classnames

simple, expressive API for tailwindcss + react-native
2.08k stars 84 forks source link

Fix duplicated style priority #279

Closed doong-jo closed 8 months ago

doong-jo commented 9 months ago

fix #245

The indexOf method returns the index of the first occurrence of the searched element, effectively removing duplicated classes that appear later. Modify it to use lastIndexOf instead, so that the earlier duplicated class gets removed, prioritizing the class appearing later.

jaredh159 commented 8 months ago

thanks for this. looks like a super straightforward fix for (hopefully all of the variations of) #245. merging 👍