Closed xfyre closed 4 years ago
Thanks for report. This is already known issue #618 We got this fixed in #623 and it will be publically available soon in a stable release
@xfyre for now, to setup new project, please follow this guide
@artyorsh Thanks - I have already done that. But I have troubles figuring if that's possible to transparently migrate from NativeBase (in particular, TopNavigation
component appears unstyled even when put inside ApplicationProvider/Layout).
That's why I wanted to take a look at some minimalistic example to understand what else do I need to do to make it work.
@xfyre It should work if you correctly configured ApplicationProvider
.
Please create a snack or share some code snippets here if it still actual
@artyorsh From the documentation my understanding is that plugging in theme & mappings is enough to make it work. It was done as described (I have inspected RN hierarchy and everything seems to be in place), however it still doesn't work.
Basically it's something like this:
(defonce eva-design (js/require "@eva-design/eva"))
(defonce ui-kitten (js/require "react-native-ui-kitten"))
(defonce eva-mapping (oget eva-design :mapping))
(defonce eva-light-theme (oget eva-design :light))
(defonce application-provider (r/adapt-react-class (oget ui-kitten :ApplicationProvider)))
(defonce layout (r/adapt-react-class (oget ui-kitten :Layout)))
(defonce top-navigation (r/adapt-react-class (oget ui-kitten :TopNavigation)))
[application-provider
{:theme eva-light-theme :mapping eva-mapping}
[layout [top-navigation {:title "something"}]]
Layout component is also wrapped by several layers of react-navigation components.
Since I'm using ClojureScript - it's quite difficult to provide an example that would work for others, and it might be that the way Reagent wraps around React - interferes with UIKitten somehow.
I might try to re-create it outside of the current project in a minimalistic way to find out what's wrong.
@xfyre Actually I have no idea how does Clojure/Reagent work, but we provide styles to components with React.Context (this is why you need ApplicationProvider
as root component). Can it be so that Reagent is not able to work with it?
@artyorsh I dug into this briefly and found https://github.com/reagent-project/reagent/issues/330 (tl;dr - it claims that React context is supported, but somehow the issue is still open).
I'll check this further, thanks for the pointer!
@xfyre Please notify if you will be able or not to make it work :)
@artyorsh I've checked and from the way it looks - context is successfully passed to the TopNavigation
component: https://take.ms/uu2tu.
UPD: in fact, theme is working to some extent (colors seem to be correct when switching to Dark theme). But font size and styling is very different from what's seen in the Kitten Tricks app. Apparently I'm missing something else here?
@xfyre we use custom fonts in Kitten Tricks (OpenSans). You can try using custom fonts too, but it works properly in React with system fonts on both platforms (Roboto for Android and San Francisco for iOS)
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
I'm running:
as described on the project page. I'm receiving the following error:
Expected behavior:
The command should create a new app skeleton from template.
Steps to reproduce:
Run the command as described above.
Related code:
Not applicable.
Other information:
OS, device, package version
Note: the issue is reproducible with with and without yarn installed.