How do you import and export all React-Native styling classes in custom.js?

0
When creating styling classes, you might run into the problem of having to import classes from a folder structure, and then having to export these again for use in Mendix. This can be done best in the following way:   import * as Buttons from "./components/buttons"; import * as Typography from "./components/typography"; module.exports = { ...Buttons, //Buttons ...Typography, //Text//Typography }; In here, all classes from the file in components/buttons.js are grabbed and grouped in an object called Buttons. Subsequently, the spread operator (...) unpacks all those classes from the Buttons object, so they can be exported in module.exports.  Likewise, there is no need te manually add classes to the import/export sections any more. Hope this helps, as there was no documentation on this. Best regards, Wouter
asked
1 answers
0

Thanks Wouter for Sharing the Knowledge.

answered