Giter Club home page Giter Club logo

Comments (5)

alexanderchan avatar alexanderchan commented on May 24, 2024 3

We want to avoid global state where possible and I'd consider using react context before redux to reduce the dependencies on other libraries.

from fundamental-react.

alexanderchan avatar alexanderchan commented on May 24, 2024 1

It seems that useReducer that will arrive with react hooks could provide some of the functionality of redux https://reactjs.org/docs/hooks-faq.html#how-to-avoid-passing-callbacks-down if we really need to be passing around state from upper levels to lower but I would wonder what the use case for state outside of the component tree is. Do we have an example of where we would need the state?

For most components I would expect to be able to pass in values via props.

from fundamental-react.

greg-a-smith avatar greg-a-smith commented on May 24, 2024 1

I would echo and expand on @alexanderchan's comments. Since components are not an application themselves, they should be "dumb" and accept props for any external state-like information. This allows any external consumers to use them and doesn't get coupled with a specific dependency. Components should ideally avoid state tracking entirely unless it's purely local state for the benefit of the component itself.

from fundamental-react.

CodesOfRa avatar CodesOfRa commented on May 24, 2024

thanks @alexanderchan for your input , we are still discussing this topic.

from fundamental-react.

bcullman avatar bcullman commented on May 24, 2024

Closing.

State should be managed by the application, not this component library.

from fundamental-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.