Hi, In the getting started example you use stateless widget but in the examples (TODO, HackerNews, etc ). you use stateful widget. May I know when to use stateless widget and stateful widget?
Ah nice find @campanagerald. In general always use StatelessWidgets as the stores would be outside of the Widget. If the Store is tied to the lifecycle of the Widget, then go for a StatefulWidget
@pavanpodila, is there any example where Store is tied to the lifecycle of the Widget?
The Todo example is using that idea. It creates the store in a StatefulWidget and is alive only for the lifetime of the Todo route page.
https://github.com/mobxjs/mobx.dart/blob/master/mobx_examples/lib/todos/todo_widgets.dart
Most helpful comment
Ah nice find @campanagerald. In general always use
StatelessWidgetsas the stores would be outside of the Widget. If the Store is tied to the lifecycle of the Widget, then go for aStatefulWidget