DEV Community

Discussion on: Recoil - Ideal React State Management Library?

avkonst profile image
  1. Not ideal because it does not try to do everything???
    No, because it does not solve the problem of frequent and deeply nested state updates, which might be a use case for large datasets

  2. big no-no is "overriding" useState hook itself. Why would you do that?
    It does not override it. It just have got the same name because it does the same (for the case of the local state). If it is no-no, there is an alternative name 'useHookstate' or you can name alias on import or you can use module prefixes.

  3. Why would you use the same name for different types of an argument? Because whatever the argument is, it gives you back the State object, which has got the same functionality regardless if a state variable comes from local variable, global variable, if it is Promise or not. I know for some people in JS it does not make sense, as they prefer to have different function names depending on whether an input argument is declared in a local scope or global, etc.. I disagree with this naming convention / attitude. It is ok to have different opinion.