locked
react useState v useReducer questions RRS feed

  • Question

  • User1034446946 posted

    when i first started looking a managing form handling inparticual they all use useState, and they all used models although fairly simple models.

    However going through a hooks tutorial it said useState is better for primitive types, but useReducer is better for objects and arrays.

    So i googled useState v useReducer and the articles all say the same thing but i still don't understand why.

    using setState I can still use models using dot notatiions so, I am confused to why i shouldn't use useState over useReducer

    Any thoughts would be appriciated

    Saturday, August 31, 2019 8:23 PM

Answers

  • User1034446946 posted

    answered in another post

    https://forums.asp.net/t/2159293.aspx?state+management+question+having+nested+components+in+react

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 1, 2019 10:14 PM