https://linen.dev logo
Join Discord
Powered by
# react
  • u

    user

    05/20/2019, 11:01 PM
    Friendly advice: don't use
    react-redux-form
  • u

    user

    05/21/2019, 1:25 AM
    Why?
  • u

    user

    05/21/2019, 4:40 AM
    +1
  • u

    user

    05/21/2019, 8:32 AM
    don't use redux at all ;)
  • u

    user

    05/21/2019, 8:34 AM
    +1 again :D
  • u

    user

    05/21/2019, 8:34 AM
    Or +0.5, maybe
  • u

    user

    05/21/2019, 8:36 AM
    well, it's a bit over the top ... but it's probably still better advise than "use redux" ^^
  • b

    brainy-machine-50829

    05/21/2019, 8:55 AM
    Any practical reasons why? I didn't tinker much with react before, but I got to a point where adding redux would be nice.
  • b

    brainy-machine-50829

    05/21/2019, 8:57 AM
    I didn't like that adding some part of the state meant going from root all the way down to where it's actually used. If it was some new standalone state (as opposed to just adding a property to existing one), it meant modifying all the classes from root all the way down.
  • b

    brainy-machine-50829

    05/21/2019, 8:57 AM
    The master root class got pretty bloated fast, when all it mostly did was pass stuff further down.
  • u

    user

    05/21/2019, 8:59 AM
    yeah ... well, it's off to a bad start with the whole notion of stuffing all application state into one god object ... and from there on it's still going downhill ^^
  • u

    user

    05/21/2019, 8:59 AM
    It's usually not a real problem
  • u

    user

    05/21/2019, 9:00 AM
    If you want to read things: https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367 https://stackoverflow.com/questions/49568073/react-context-vs-react-redux-when-should-i-use-each-one
  • u

    user

    05/21/2019, 9:00 AM
    a whole lot of ceremony to connect your components to the store
  • b

    brainy-machine-50829

    05/21/2019, 9:01 AM
    There's a way to avoid putting state into a god object with pure react?
  • u

    user

    05/21/2019, 9:01 AM
    well, for starters you can have some local state in your components
  • b

    brainy-machine-50829

    05/21/2019, 9:02 AM
    Hmm. I think I had reasons why I couldn't do that.
  • u

    user

    05/21/2019, 9:02 AM
    which is evil, because it's not functional ... but now you have hooks to achieve the same, and they are cool, because they are not functional ... oO
  • u

    user

    05/21/2019, 9:03 AM
    Damn, can't find the article about avoiding passing state down components
  • u

    user

    05/21/2019, 9:03 AM
    yeah, a lot of time you can actually avoid that quite well
  • b

    brainy-machine-50829

    05/21/2019, 9:04 AM
    I think I mostly had multiple separate components needing the state.
  • u

    user

    05/21/2019, 9:04 AM
    https://twitter.com/dan_abramov/status/1021850499618955272
  • b

    brainy-machine-50829

    05/21/2019, 9:04 AM
    They were deep, but at the same level of each other. So state had to go up.
  • u

    user

    05/21/2019, 9:05 AM
    Seems like a good match for context api
  • u

    user

    05/21/2019, 9:05 AM
    well, ok, sometimes you have to pull state up one level
  • u

    user

    05/21/2019, 9:05 AM
    that's not the same as dumping all of it into the root though ^^
  • b

    brainy-machine-50829

    05/21/2019, 9:05 AM
    It was a few years since I did that tool. 😄
  • b

    brainy-machine-50829

    05/21/2019, 9:06 AM
    If I'm ever gonna touch it more again, I will probably redo it with coconut and come here for structural advices. 😃
  • b

    brainy-machine-50829

    05/21/2019, 9:07 AM
    Thanks for the links kLabz, skimmed through them.
  • u

    user

    05/21/2019, 9:08 AM
    The tweet is nice for 1 or 2 level deep issues
1...678...80Latest