In MobX, the ________ decorator can be used to mark a method that intends to modify the state.
- @action
- @computed
- @observable
- @transaction
In MobX, the @action decorator is used to mark a method that intends to modify the state. This decorator is essential for maintaining the observability and reactivity of MobX's observable state. It signifies that the method can change the state and will trigger reactions accordingly. The other decorators (@observable, @computed, and @transaction) serve different purposes in MobX and are not used to mark methods for modifying state.
Loading...
Related Quiz
- If an error boundary fails while rendering the error message, the error will propagate to the nearest ________.
- How to add Google Analytics for react-router?
- How can the combination of Context API and Hooks provide state management solutions comparable to libraries like Redux?
- To ensure a prop has a default value in TypeScript with React, you can use the ________ keyword.
- Even though a Portal can be anywhere in the DOM tree, it behaves like a normal React child in every other way, especially concerning event bubbling.