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.

Android dynamic rendering not updating

See original GitHub issue

I am using react-native-svg-charts and I am seeing new behavior since updating this library. Suddenly when rendering children of the overall SVG component dynamically, they do not update regularly on Android though they do have predictable results.

For instance, with new props they will redraw, but if they are replaced with null or another invisible element with the same key they will not. The only way I’ve been able to get an update is to force it with a dynamic key on the container of the entire SVG element which causes a bad flash to occur when redrawing.

Versions:

  • react-native: 0.57.4
  • react: 16.6.0-alpha.8af6728
  • react-native-svg: ^8.0.8

For the current chart implementation of the SVG component I’m using refer here: https://github.com/alburdette619/react-native-svg-charts/blob/dev/src/chart/chart-grouped.js#L105

Then I am using that and attempting to dynamically render children using standard JSX syntax:

<LineChart...>
  {condition ? <Child/> : null}
</LineChart>

I’ve tried setting keys on the Child, setting dynamic keys to force an update, but the only thing that works is setting a dynamic key on LineChart which is the overall container for the SVG element.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
msandcommented, Jan 24, 2019

Please provide a full replication if you want progress on this

1reaction
mgonzalezscommented, Dec 21, 2018

@msand The change https://github.com/react-native-community/react-native-svg/issues/853#issuecomment-445502539 didn’t work.

<LineChart...  key={chartKey}>
  {condition ? <Child key={childKey}/> : null}
</LineChart>

If I change childKey also the child won’t re-render. If I change chartKey will re-render all the graph but this makes the graph blinks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android dynamic rendering not updating · Issue #853 - GitHub
I am using react-native-svg-charts and I am seeing new behavior since updating this library. Suddenly when rendering children of the overall ...
Read more >
Slow rendering - Android Developers
To do this, collect frame render times from specific parts of your app with FrameMetricsAggregator and record and analyze the data using Firebase...
Read more >
How to dynamically update layouts in android studio
1 Answer 1 ... You can use RecyclerView to populate views dynamically. RecyclerView is the most efficient and optimized. Useful resources:.
Read more >
Dynamic Rendering | Google Search Central | Documentation
Dynamic rendering is a workaround for websites where JavaScript-generated content is not available to search engines. A dynamic rendering server detects bots ...
Read more >
Android 13 changelog: A deep dive by Mishaal Rahman
The early preview builds provided an early look at Android 13 and introduced many — but not all — of the new features,...
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