Coder Social home page Coder Social logo

Comments (5)

dai-shi avatar dai-shi commented on August 21, 2024 1

That's exactly what I do in react-tracked with useSelector.
So, I don't want the duplication.

More importantly, this library is something that will be obsoleted when React provides a native solution. So, we shouldn't add a new feature.

If react-tracked doesn't fit for you (as it also has useTrackedState), you might want to create a new library. (and list in https://github.com/dai-shi/use-context-selector#projects-that-use-use-context-selector)

from use-context-selector.

scottrippey avatar scottrippey commented on August 21, 2024

I created a draft PR here: #77
Open for further discussion!

from use-context-selector.

scottrippey avatar scottrippey commented on August 21, 2024

Cool, totally understand. I'll copy-paste this utility in my projects for now, especially since it's just a tiny file.

I'm looking forward to a native React solution! Are you referring to useMutableSource, or some other API that I should be aware of?
I'm surprised React has been missing this feature for so long ... this library provides such a good performance-friendly, code-friendly API, that it really does need to be a native React feature.

from use-context-selector.

dai-shi avatar dai-shi commented on August 21, 2024

I'm referring to the useContextSelector being experimented in React.
reactwg/react-18#73

from use-context-selector.

scottrippey avatar scottrippey commented on August 21, 2024

Oh, that's awesome to hear. I wasn't aware of this experiment; I will eagerly start watching for that! Thanks for the heads up.

from use-context-selector.

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.