Code Monkey home page Code Monkey logo

givemelove-react's Introduction

Give Me Love

A valentines-inspired clicker web app where single people all over the world can give each other some love through a heart on their screen

Themes

Dark Mode

Light Mode

givemelove-react's People

Contributors

yilverdeja avatar

Stargazers

 avatar

Watchers

 avatar

givemelove-react's Issues

Counter is increasing by a lot of clicks sometimes

Uncertain what happened, but counter just went from 19k clicks to 22k clicks. This has happened previously, but it went up by 1k so I was uncertain if I just forgot.

Not sure how to recreate the error, but I'll take a look into the code later.

Canvas re-drawing too many times when total count is updated

Issue

The canvas element is re-drawing too many times when total count is updated. This means that some components are being re-rendered multiple times.

Info

Expected behavior: When the heart is clicked, the page should re-draw the pixels on the Canvas just once.
Current behavior: When the heart is clicked, the Canvas is re-drawn 4 times.

What's happening:

  • When the heart is clicked (total count increased by 1), the page is redrawn
  • Then after not-clicking consecutively for some time, a debounce fires and updates the global counter on Firestore. The page is redrawn twice (hard to see on the Gif, but it flashes really quickly)
  • Then the page is re-rendered and re-drawn again. The useEffect for the debounce is called once more again

Fix Expectations:

  • Only when the total count is updated, then the canvas is re-drawn
  • Changing the theme, and refreshing the data (and seeing no changes), should not result in a re-drawn canvas

Recording 2024-02-27 at 11 32 24

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.