Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

reactjs - 状态信息通常存储在React编写的应用程序中的哪个库中?(In which library is the state information typically stored in a React-written application?)

so the question on title, do you know where state is stored?

(所以标题问题,您知道状态存储在哪里吗?)

Thanks.

(谢谢。)

  ask by qwerk63 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

React let's you choose, you can either use:

(React让您选择,您可以使用:)

  • React's own state functionality (useState or useReducer hooks)

    (React自己的状态功能(useState或useReducer挂钩))

  • as your app grows you might look into libraries like React Redux and Mobx Statetree to structure and handle your state.

    (随着应用程序的增长,您可能会考虑使用React Redux和Mobx Statetree之类的库来构造和处理您的状态。)

React Redux is the de facto standard, whereas Mobx Statetree is generally considered easier to use (and just as powerful).

(React Redux是事实上的标准,而Mobx Statetree通常被认为更易于使用(并且功能强大)。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...