Code Monkey home page Code Monkey logo

Comments (10)

ealush avatar ealush commented on May 23, 2024

Hey, I am trying to reproduce with your example but I am not sure I am experiencing the bug. Would you mind sharing forking this blitz and sharing what you experience?
https://stackblitz.com/edit/emoji-picker-react-gxa6r9?file=index.js

click fork at the top:
image

from emoji-picker-react.

mflash123 avatar mflash123 commented on May 23, 2024

Hey, I am trying to reproduce with your example but I am not sure I am experiencing the bug. Would you mind sharing forking this blitz and sharing what you experience?
https://stackblitz.com/edit/emoji-picker-react-gxa6r9?file=index.js

click fork at the top:
image

Thanks for reply.
I post a code:
https://stackblitz.com/edit/emoji-picker-react-uxwzsl

UPD
It doesnt depends from child, in a same component, same problem
https://stackblitz.com/edit/react-ck9qgf

from emoji-picker-react.

ealush avatar ealush commented on May 23, 2024

I see. this is really weird. I will have to debug this. Thanks for reporting.

from emoji-picker-react.

j-edward avatar j-edward commented on May 23, 2024

Is there any update on this?

from emoji-picker-react.

jlevy-io avatar jlevy-io commented on May 23, 2024

I slightly adjusted your code and it seems to work this way. Nothing was being re-rendered so the value was not changing. I added a useEffect that re-renders the App component when value changes

https://stackblitz.com/edit/emoji-picker-react-jakfvz

from emoji-picker-react.

LetHergo avatar LetHergo commented on May 23, 2024

yes, I also have this problem.
onEmojiClick callBack can not get props value
@ealush

from emoji-picker-react.

zpzxgcr avatar zpzxgcr commented on May 23, 2024

yes, I also have this problem.
onEmojiClick callBack can not get props value
@ealush

from emoji-picker-react.

ealush avatar ealush commented on May 23, 2024

Hey guys, sorry for taking so long with this.

I believe that the latest version (3.2.3) should solve this issue.

For anyone interested in the details: 2e19179

The picker had two bugs that caused this unexpected behavior.

  1. Stored the consumer's onClick handler in the useReducer hook as an initial value, meaning that it never got refreshed past the initial render - so it always stuck with the first initial scope references. But fixing this was not enough because:
  2. Some of the emoji components are memoized, so they only kept reference to the recent-render handler, which lead to outdated scope variables. Now I store your click handler inside a ref, and always access the function from there.

These two seem to solve the issue, can anyone please post back to see if it works.

from emoji-picker-react.

paladin952 avatar paladin952 commented on May 23, 2024

I still face this issue on 4.5.1

from emoji-picker-react.

ealush avatar ealush commented on May 23, 2024

Hey @paladin952 this is a closed and old issue. Can you please create a new issue with reproduction steps?

from emoji-picker-react.

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.