Coder Social home page Coder Social logo

Keep global state? about crush2020 HOT 3 CLOSED

spacedogxyz avatar spacedogxyz commented on August 29, 2024
Keep global state?

from crush2020.

Comments (3)

camdenlee avatar camdenlee commented on August 29, 2024

@jlev I can take this on. Can you point me to the areas in the application you'd want to use global state? I did a quick search for useState and found a few items, but all of them might not necessitate global state.

This might not need the complexity of Redux and React Context could do the trick instead. Do you have a strong preference?

from crush2020.

jlev avatar jlev commented on August 29, 2024

Thanks @camdenlee! The form has a context provider in https://github.com/spacedogXYZ/crush2020/blob/master/src/components/form/context.js, which is used in the PlanForm component. That's pretty close to redux style (reducers, etc), and works to keep track of user state when they progress normally through the flow.

But, I'm seeing some weird issues when someone navigates away from the form (to eg, Methodology) and then back. Progress is lost, which is not a deal breaker but isn't a great experience. The worst problem is that when you reload a form step (even the first one), it renders with a broken layout which doesn't make sense to me...

  • After navigating to form/vote directly

Screen Shot 2020-09-14 at 9 38 57 AM

  • After starting to fill out the form and then reloading

Screen Shot 2020-09-14 at 9 39 13 AM

from crush2020.

jlev avatar jlev commented on August 29, 2024

Fixed with #19

from crush2020.

Related Issues (18)

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.