Questions tagged [mobx-react-lite]

67 questions
0
votes
2 answers

What's the difference between @computed and @action in MobX?

What's the difference between @computed and @action in MobX? They both are functions, so what is difference between them?
sima ghoreyshi
  • 379
  • 5
  • 21
0
votes
2 answers

Mobx Generic Observer using Typescript typing

I would like to wrap the following function in mobx's observer(), but can't seem to figure out how to do that (or if it's possible) while maintaining the generic typing: interface GenericProps { arg: T; } const foo: (props: GenericProps)…
Jonas
  • 1,473
  • 2
  • 13
  • 28
0
votes
3 answers

Error: mobx-react-lite requires React with Hooks support

I cannot launch my application. I have no clue what I am searching for. Everything seems good. In the very beginning, I tried to change my store from redux to mobx. Everything I've done is mostly about typescript babel transformation etc.…
0
votes
1 answer

why useObserver hook won't rerender twice, comparing to observer hoc?

I'm reading the docs of mobx-react-lite and confusing with the difference between observer hoc and useObserver hook. According to the docs, observer hoc will trigger re-render twice while useObserver won't: One good thing about this is that if any…
lamhoit
  • 3
  • 2
0
votes
1 answer

How to use MobX obervables to cause a 3rd party React Component (FullCalendar) to render?

I am trying to wrap FullCalendar React component with my own functional React component with useContext hook to access MobX store (I might use the store in other components eventually) and observer() to make it react to changes in the store. My…
Moglum
  • 113
  • 2
  • 7
0
votes
1 answer

Why does the observer not react on updates in my store?

I'm trying to get mobx to work with my react hooks and I am starting off with a very simple example but it still does not work. I must have missed something but I have been trying for hours to find what that might be. Here is my store: import {…
Heddelin
  • 206
  • 1
  • 9
-1
votes
1 answer

Clone observable object from Mobx observable array

Mobx store: Contains array of object of type person, Person class has nested array, other class methods(Assume we don't have ID so we are not creating Map) @observable persons: Person[] = [] @observable selectedPerson: Person; @action…
ksh
  • 639
  • 1
  • 7
  • 23
1 2 3 4
5