i use both NativeWind
and twrnc
in my project.
suppose i have a component looks like this.
import tw from "twrnc";
...
const Test=(props)=>
{
console.log(props);
return <View style={tw.style(`border`,props.style)}>
<Text>hello</Text>
</View>
}
and when i try to use this component like this
<Test className="bg-red-400 text-red-400" />
it will print out the props like this:
style: [{backgroundColor: '#f87171'},{color: '#f87171'}]
the NativeWind transformed classname into style but as an array.
then tw.style
will popup an error which says TypeError: str.trim is not a function (it is undefined)
is it possible to ask NativeWind not transform classname into style array, but a single style object?
for example, style: {backgroundColor: '#f87171', color: '#f87171'}