How to use Mobx with React Hooks

How to use Mobx with React Hooks

Ben Awad

5 лет назад

32,437 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Loba
Loba - 24.06.2022 20:19

where is the second part?

Ответить
Vu. Assignment
Vu. Assignment - 16.10.2021 21:25

can any one tell me how this is different from context api

Ответить
Punreach Rany
Punreach Rany - 01.04.2021 03:44

Do I have to write in Typescript if I want to use mobX?

Ответить
Mario Iliev
Mario Iliev - 03.03.2021 19:54

Damn that's a boilerplate that I would liike to avoid. I prefer something easy to use like "Store me".

Ответить
Stephen Rayner
Stephen Rayner - 14.11.2020 15:40

What's up with;

```
"mobx": "^6.0.4",
"mobx-react-lite": "^3.1.6",
```

If I click the button it doesn't rerender. But if I go to my file make an edit and save to get the hot reloading update then the counter shows the new state. Is anyone else experiencing this issue with the latest versions. Works fine with;

```
"mobx": "^5.9.0",
"mobx-react-lite": "^1.0.1",
```

Ответить
kristaponbubu
kristaponbubu - 20.07.2020 15:36

по русски разговаривай идиотина ,я тебя не понимаю!!!

Ответить
Natanael Fernandes
Natanael Fernandes - 17.07.2020 17:41

saved me, works fine!

Ответить
Wagner CS Filho
Wagner CS Filho - 13.07.2020 05:58

Provider component?

Ответить
j-personal-projects
j-personal-projects - 01.06.2020 00:55

How do I persist state with mobx and react hooks?

Ответить
Aleksandar Hough
Aleksandar Hough - 08.04.2020 16:47

fantastic tutorial!! thanks

Ответить
Saleem Khan
Saleem Khan - 12.03.2020 16:26

I was wondering why did you wrap the count store in context, when we can use the store directly? is there any advantage of wrapping it in context?

Ответить
Daniel Lefevbre
Daniel Lefevbre - 31.01.2020 00:48

I don't have a tsconfig or a jsconfig. I've been in hell trying to get rid of this error -- using CRA3 and JS

Ответить
Krešimir Ćosić
Krešimir Ćosić - 19.10.2019 15:25

Very cool, I am having difficulties with MobX now, the page renders indefinitely after a Promise with data resolves and fills up an array with data. No idea why...

Ответить
Isosceles Kramer
Isosceles Kramer - 16.09.2019 12:30

Getting the "Invalid Hook Call" error when using the useContext hook when the component is wrapped in observer()

Ответить
Sebastien Royer
Sebastien Royer - 28.08.2019 21:29

Only works with JS scalar types (types.string, types.number, etc..). If MobX Store property if of type "types.array(Other model)" or "types.map(Other model)", react hooks does not take care of those properties updates (useEffect/useMemo/etc). Do you why ?

Ответить
ZulQ
ZulQ - 19.07.2019 14:21

i'm getting error *
error: bundling failed: Error: Unable to resolve module `mobx-react-lite`*

if i go to root directory node_modules it showing me *mobx-react-lite*.
can u plz help me

Ответить
qazyhn94
qazyhn94 - 30.06.2019 23:27

this tutorial is sick, I like it!!

Ответить
muratas arslan
muratas arslan - 08.04.2019 23:15

Very helpful, thank you Ben.

Ответить
Gonzalo Rodríguez
Gonzalo Rodríguez - 17.03.2019 22:20

how difficult it will be to create a react-native-web-cli with a create-rnw command that creates a folder with all the packages configurated? i dont have any idea of how to do it, but it will be a good exercise if you ask me, i'm in to try to help if you want to do it

Ответить
fr3fou
fr3fou - 20.02.2019 18:09

How do you decide when to use interface vs type

Ответить
impzero
impzero - 20.02.2019 16:16

Where are you willing to store the workouts data, firebase?

Ответить
Lessep922
Lessep922 - 19.02.2019 23:06

Seems good BUT i think using mobx with hooks is not ideal (or maybe i still dont get it) why? because the magic of mobx is that you pick which properties you want your component to listen without all that extra setup by default. Anyway you're awesome Ben!

Ответить
Daniel Dosen
Daniel Dosen - 19.02.2019 23:04

Will you build in an ability for the React-Native app to work 'offline' / not connected to a server?

Ответить
Daniel Dosen
Daniel Dosen - 19.02.2019 23:01

I like using the data format like '2019-02-19' as that's how postgresql uses/displays dates natively.

Ответить
Cake
Cake - 19.02.2019 20:20

Silly question perhaps, but CMD + Space doesn't open up the intellisense / import thingy... How did you set that up?
And what is currently set to your CTRL + period?

Ответить
Mayur Shah
Mayur Shah - 19.02.2019 19:51

Amazing content as always

Ответить
Etienne Fichot
Etienne Fichot - 19.02.2019 19:35

I just don't understand anymore why use something else to manage the store, than the context.

Ответить