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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *