Code Monkey home page Code Monkey logo

Comments (5)

toomuchdesign avatar toomuchdesign commented on August 25, 2024

Hi @mledwards, would you mind putting together e repro?

from react-minimal-pie-chart.

mledwards avatar mledwards commented on August 25, 2024

Hi @toomuchdesign, thank you for taking a look.

Here's the repo: https://github.com/mledwards/react-minimal-pie-chart-example-in-next

This should replicate the issue above in the console every time you refresh the index page (SSR).

My best guess is that the way server side JS calculates float numbers is slightly different to the way client side JS calculates them, and after 15 decimals points it deviates.

Maybe the decimal place could be capped at 15 points so both the server and the client return the same number? Not sure if this would have any adverse affects on the rendering?

from react-minimal-pie-chart.

toomuchdesign avatar toomuchdesign commented on August 25, 2024

Thanks @mledwards! What browsers/OS you're experiencing this issue with? Can you reproduce consistently on different browsers?

from react-minimal-pie-chart.

toomuchdesign avatar toomuchdesign commented on August 25, 2024

I assume it's an issue about how different JS engines handle float numbers. V8 seems to work consistently across Node and Chromium/Blink browsers. Not totally sure we should address this in user land, but It let's discuss possible solutions/workaround.

The glitch here is that non-Chromium/blink users might perform and extra render loop after mount which I'd be glad to avoid.

from react-minimal-pie-chart.

mledwards avatar mledwards commented on August 25, 2024

I'm on a Mac and can see it on Firefox and Safari, but not on Chrome and Edge. Sorry, I should have mentioned that in the original message.

Maybe I'll try and suppress that Next.JS warning.

from react-minimal-pie-chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.