react visualize re-rendering/ updating elements - reactjs

I am rendering thousands of svg elements using react, and want to make sure that minimal rendering is done in case of change in input. sometimes a single node is updated, and since I don't do any shouldComponentUpdate, it should be re rendering all the elements. I wonder is there a package available to visualize the changes. I see two packages
https://github.com/redsunsoft/react-render-visualizer
https://github.com/spredfast/react-transform-render-visualizer
but what I am really after is how it is done in this article
http://blog.atom.io/2014/07/02/moving-atom-to-react.html
how can it be done? any package available?

There is a setting in Chrome's DevTools that provides a very similar visualization called Show paint rectangles or Paint Flashing. Go to DevTools and hit the escape key on your keyboard. Go to the rendering tab in the panel that appears and choose "Show paint rectangles" or "Paint Flashing":

Related

How do I prevent layers from rendering in 3d with Mapbox?

Layers are being rendered in 3d, making them difficult to click, and look bad in general.
As you can see in the image, the dots are rendered about 500 ft off the ground. I'm not aware of any configuration changes I made to enable this, and I can't figure out how to prevent it from happening, although it only seems to happen to some layers (as you can see in the screenshot)
I've tried reordering the layers in Mapbox Studio, but I don't know what else I would change, as this seems to happen regardless of any js changes.
It seems like this was an issue with react-map-gl not being able to render 3d styles correctly. Setting the map to "2d" in Mapbox Studio and using a raster source to generate the 3d terrain seems to have fixed the issue.
https://visgl.github.io/react-map-gl/examples/terrain

Why is React Interact JS intergration not updating correctly?

I am trying to integrate InteractJS and ReactJS and I am seeing a strange but predictable problem on moving items from one dropzone to another and a mismatch between the UI and the underlying state object array. I realise this is most likely a bug in my code due my limited knowledge or React updates and/or InteractJS events - or both - but after three days staring at it I am very grateful for any insight into what may be causing this problem.
I have created a minimal codesandbox to demonstrate the problem.
I can drag all of the items into a dropzone and between dropzones in reverse order and both state and rendered output correctly updates.
However if I drag an intermediate item (i.e. not the last one) from a dropzone into another, React incorrectly re-renders the object immediately succeeding the dragged item in the wrong dropzone.
My question is: Why does the React render not match the state object for intermediate items but works correctly dragging items in reverse order?
Thanks
While researching how to handle multitouch gestures (drag and drop, zoom rotating, etc. of elements) in React.js I first found interactjs. It didn't worked well and after some more research I found enter link description here. Good documentation and it works very well with animation libraries.
I would strongly recommend not to use interactjs in a React project.

Horizontal ScrollView Loop in React Native

Checked different settings and sources, but can’t find the way to make an infinite horizontal scrolling with React Native, so that e.g. when the last image is reached, the next gesture would lead to the first image. Am I missing a setting, or is there a more sophisticated way of doing this? Please advise and if possible, share some code. Using external libraries is very undesirable.

How to step through a GIF animation based on the browser's scroll position?

I have a GIF that I will use in a React web app I am building. I want to be able to step through the animation based on the scroll position of the site.
I.e. when I have scrolled through 50% of the page, then I want the gif to display the image at its 50% position.
The gif will be in a div, position:fixed. So it will always live in the top corner of the browser.
The web app is a react app so if it's possible that there's a react library that implements this then that would be great.
Thanks!
There appears to be at least one ready made React implementation for dealing with the interaction with/playing of the GIF that may be able to assist you in your project.
React Gif Player is a React component which creates a GIF player similar to Facebook's implementation. It also comes with a pause function (and an example), which you may be able to use to programatically pause the GIF at corresponding points based on your scroll position.
Gif Frames is a pure JavaScript tool for extracting GIF frames and saving to file. You may be able to create individual frames and correspond frames with certain points of the scroll.
I'm not aware of a gif player that implements exactly what you were hoping for, although others may be able to assist in this regard. If not, you may have to use a combination of, or do a full implementation yourself.
Hopefully this helps.

Foundation Framework and React - reInit accordion not working

Problem
I call setState to add a new recipe to my recipe list
The recipe is a new panel in a Foundation accordion
The accordion title pops up immediately
There is no functionality until page refresh
I have tried everything i can think of including Foundation's reInit, their manual toggle, up, and down methods for accordions, and re constructing the whole accordion
nothing works
This is the solution I came up with.
i was able to call $("#element").foundation("toggle",$target,true) from the console and programmatically open and shut the accordion tab.
element is the accordion wrapper and target the specific tab, true is a param to indicate reflow needed
implementing that function into my app was more trouble than it was worth, for a number of reasons.
i ended up just calling location.reload() and which essentially is like pressing the refresh button. with a modal animation running at the same time it is barely noticeable
so when all else fails manual over-ride could be a viable solution depending on what your individual page is
There is a real answer
in my research i came across quite a few similar github issues that had to do with Foundation plus some sort of dynamic rendering and/or third party framework/library. every situation is a bit different so there isn't one answer
if someone has specific knowledge of what why Foundation or React(possibly), wouldn't let me reInit,reflow,$(document).foundation or do any of the various supposed solutions: I would love to know.
perhaps I could have done something different but if you look at my code I keep state to one component, I init my js plugins in componentDidMount - as far as i know this is what i am supposed to do. thanks

Resources