Closed alfonsodev closed 8 years ago
This looks good ! I would merge but waiting on @sabeurthabti to confirm :+1:
done @alfonsodev @alexmick thanks both. Sorry for the delay.
Ah there is one problem though @alfonsodev, the signature of the parse
function has been changed which can break some stuff (eg. my grunt plugin 😄 ). Passing the callback as the fourth argument like before will not get called now. I don't think it's important enough to change back but a best practise in the future would be to add new arguments to the end and specifying a cb=false
as default for the callback.
This pull request adds a boolean --literal argument, false by default. When this argument is true, the
utils.outputReactFriendlyStyle
function will generate a javascript literal object instead of using theStylesheet.create
construct.Why a literal object ?
From React docs: Stylesheet.create is optional ...
Having a literal object has it's own advantages, for instance in components that use string props to change its style, we can still use the generated styles as string.
But Stylesheet.create turns the object keys into numbers making it not accesible anymore.
This pull request lets the user choose what construct they want for their styles.
I hope you like it :)