v4: remapProps documentation, should I use it for className to style mapping? #601
-
@marklawlor The current docs for e.g. I'm using react-native-vector-icons which takes a standard style tag. remapProps(FontAwesome6Pro, { className: 'style' }); Or am I missing something here? It seems to work in my testing. If this is the case, I would suggest extending the remapProps(FontAwesome6Pro); Let me know if that makes sense, and I can create a PR |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Now I'm even more confused. If I don't remap anything import FontAwesome6Pro from 'react-native-vector-icons/FontAwesome6Pro';
import LinearGradient, { LinearGradientProps } from 'react-native-linear-gradient';
// BAD - Style isn't applied
<FontAwesome6Pro className="text-pink-300" name="smile" />
// GOOD - style is applied
<LinearGradient className="border-[50px]" {...linearGradient} {...props} />; Is there some dark magic I'm missing somewhere? |
Beta Was this translation helpful? Give feedback.
Yep that was the issue. I decided to enable the interop for all native modules, so it should work in
4.0.4
. However,react-native-vector-icons
sets a default color, so you will need to either:!text-pink-300
Either method will work, as they increase the style specificity