简体   繁体   English

会在没有 redux 的情况下管理 state 吗?

[英]will react manage the state without redux?

How to manage the state in React without using Redux and Hooks .如何在不使用ReduxHooks的情况下在React中管理 state。 Is there any new concept is there?有什么新概念吗?

Yes, you can manage state without redux, see State and Lifecycle in the documentation.是的,您可以在没有 redux 的情况下管理 state,请参阅文档中的State 和生命周期 If you're using hooks, you mostly use useState ( more here ).如果你使用钩子,你主要使用useState更多在这里)。 If you're writing class components, you use the state property and setState .如果您正在编写 class 组件,则使用state属性和setState

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM