'React Material-UI, Kotlin and themes

I am trying to use material-ui from Kotlin. (Am going quite well and will release it to the public if it all works OK.)

I am a bit of a newbie to Javascript (and Kotlin for that matter).

I am looking for a simple way to expose a theme to my components. I have looked at the withThemes stuff, but it is not working supper well for me.

I would like to define some type of global (maybe) theme object.

Is there an easy way to get the current theme without wrapping the component using withThemes?

Thanks for any help. C



Solution 1:[1]

I got Material-UI working from Kotlin. (I have created a Kotlin wrapper - MUIRWIK), and in particular, for the question it is the MuiThemeProvider that provides the more or less globally accessible theme object.

Solution 2:[2]

Since the question was made, JetBrain released a wrapper library called kotlin-mui that brings Material Design UI to React components from MUI.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stephen Rauch
Solution 2 Allan Veloso