question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

customMapping problem when implementing dynamic theme switcher

See original GitHub issue

Issue type

I’m submitting a … (check one with “x”)

  • bug report
  • feature request

Issue description

I am trying to implement a theme switcher using KittenTricks and this example in this repo. Everything works as expected until i try to implement a custom font family using customMapping like in this example. If I pass in a customMapping prop, the theme switching breaks and many of the styles no longer change.

Current behavior:

It seems that once an initial customMapping is applied, dynamically switching the theme does not refresh all the styles leaving some aspects of the light theme mixed in with other aspects of the dark theme.

Expected behavior:

Dynamically switching themes when using a customMapping should refresh all the styles.

Steps to reproduce:

Pass in a customMapping into the ApplicationProvider when using a theme switcher like in this example

Related code:

I’m not too familiar with setting up and sharing an Expo playground to provide any samples.

Other information:

OS, device, package version

"react": "16.9.0",
"react-native": "0.61.1",
"@eva-design/eva": "^1.2.0",
"react-native-ui-kitten": "^4.2.0",

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
David-Melocommented, Nov 11, 2019

@artyorsh Yes, thank you. I was able to find a work around.

I was generating a customMapping for each of my themes, this is what was giving me the problem. I simplified my customMapping to work for both themes so that it wasn’t something that was affected by switching themes since that prop on the ApplicationProvider no longer changes with the theme switch.

Although I do suspect that If I did need to switch the customMapping I would still have the issue.

0reactions
Jonatthucommented, Oct 27, 2020

Is there any better way to make this work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create a dynamic theme switcher in Flutter
This article will guide you on how to create a dynamic theme switcher that can switch between three colors, generating a dynamic theme....
Read more >
Dynamic theme change in Semantic-UI - Stack Overflow
I need to test this now, but I may have an answer for my own question here. It seems that the gulp build...
Read more >
Leaflet mapbox - Seba Online
Example: Use the Leaflet API in Mapbox. maplibre-gl-js - Fork mapbox-gl-leaflet plugin and support maplibre TypeScript. env. Display beautiful, responsive ...
Read more >
Style/Theme switcher | OutSystems
Style /Theme switcher. Question. How do I change(switch) eSpace user custom theme based on which user has logged in? Example -
Read more >
custom all value grafana
Include dynamic content from grafana (find here a reference for all asciidcotor ... Utilization Graph Panel - Multiple Servers & Problem Statement to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found