Closed wh-Coder closed 6 years ago
@wh-Coder that's tricky, because ideally we need to convert React.Fragment
into <React.Fragment />
. Not to <React className="Fragment" />
or <React className={Fragment} />
.
To set class names for RN you can define classes as you do with JSX:
View(class=styles.wrapper)
Text(class=styles.text)
If I misunderstood your concern, could you give more details?
This isn't a react vs. react native thing. The syntax is exactly the same for React vs. React Native. <Foo bar="value" />
is a shorthand for <Foo bar={'value'} />
and is supported on all React platforms. It just means that it's the literal string, not the value of a variable.
Know from the documentation:
React.Fragment becomes \<React className="Fragment" />
but in RN Use braces instead of quotes:
\<React className={Fragment} /> or \<React className={[Fragment1, Fragment2]}/>