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?
@bawad4 жыл бұрын
I don't think so, at the time I didn't know you could use it directly
@loba89242 жыл бұрын
where is the second part?
@qazyhn945 жыл бұрын
this tutorial is sick, I like it!!
@MrJoaopaulofurtado4 жыл бұрын
How do I persist state with mobx and react hooks?
@muzamilhussain99083 жыл бұрын
can any one tell me how this is different from context api
@impzeropvp6 жыл бұрын
Where are you willing to store the workouts data, firebase?
@bawad6 жыл бұрын
I was going to store them in localStorage
@techstacker53616 жыл бұрын
@@bawad if it's localStorage, then you won't be able to access the same exercise data on the web/mobile version? Or will the data be sync’d between mobile & web?
@bawad6 жыл бұрын
yeah we won't be syncing between app/website, so each will have different data
@fr3fou6 жыл бұрын
How do you decide when to use interface vs type
@bawad6 жыл бұрын
interface for objects and types for everything else
@arafatzahan36974 жыл бұрын
@@bawad OOh my, never thought it like that. Makes too much sense now haha
@punreachrany57063 жыл бұрын
Do I have to write in Typescript if I want to use mobX?
@zulq20755 жыл бұрын
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
@zulq20755 жыл бұрын
it's working on the web but not on native
@bawad5 жыл бұрын
I couldn't get the native to work either
@zulq20755 жыл бұрын
@@bawad so why we created three folder(web, common, app) , is there any method so i can i use only one codebase for web and mobile.
@bawad5 жыл бұрын
yeah, checkout expo web
@minionsmedia17614 жыл бұрын
@@bawad Did this thing started working on native now ? curious.....
@danieldosen52606 жыл бұрын
I like using the data format like '2019-02-19' as that's how postgresql uses/displays dates natively.
@bawad6 жыл бұрын
I'm cool with using that
@wagnercsfilho4 жыл бұрын
Provider component?
@mayur98766 жыл бұрын
Amazing content as always
@bawad6 жыл бұрын
thanks!
@muratasarslan23595 жыл бұрын
Very helpful, thank you Ben.
@goulenstring5 жыл бұрын
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 ?
@bawad5 жыл бұрын
Weird, I'm not sure
@aleksandarhough77104 жыл бұрын
fantastic tutorial!! thanks
@gonzalochristobal5 жыл бұрын
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
@gonzalochristobal5 жыл бұрын
a workspace generator
@gonzalochristobal5 жыл бұрын
its kinda hard getting the workspace configurated to get up and running
@bawad5 жыл бұрын
yeoman.io/authoring/index.html
@gonzalochristobal5 жыл бұрын
@@bawad thanks!
@kresimircosic37535 жыл бұрын
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...
@Chocoholic13376 жыл бұрын
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?
@bawad6 жыл бұрын
They are default keybindings CTRL + Space brings up intellisense CMD + period brings up quick fix menu which includes imports
@gosnooky5 жыл бұрын
Getting the "Invalid Hook Call" error when using the useContext hook when the component is wrapped in observer()
@danieldosen52606 жыл бұрын
Will you build in an ability for the React-Native app to work 'offline' / not connected to a server?
@bawad6 жыл бұрын
yeah, we are going to be saving the data to AsyncStorage/Localstorage
@natanaelfernandes25654 жыл бұрын
saved me, works fine!
@Lessep9226 жыл бұрын
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!
@bawad6 жыл бұрын
I think it still works like that. The component we made will listen for when the count field changes. Hooks just make the syntax for it a little different.
@SalientKnight5 жыл бұрын
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
@bawad5 жыл бұрын
I think you need to add a babel plugin
@MarioIliev3 жыл бұрын
Damn that's a boilerplate that I would liike to avoid. I prefer something easy to use like "Store me".
@deannno16 жыл бұрын
I just don't understand anymore why use something else to manage the store, than the context.
@Chocoholic13376 жыл бұрын
From my own experience: context is used for shared component state / props that don't change often or that isn't complex (application-wide theme as example). As soon as you start using complex state logic, a store starts to make a lot more sense. I'm sure Ben can give his own experience on the matter.
@bawad6 жыл бұрын
mobx is an alternative to useState, either way you would/could use context
@devilmanscott6 жыл бұрын
One main reason usually more tooling, but another is that it's normally more optimised.
@chaimochs74374 жыл бұрын
@@bawad So, I should use both observables/observers and context?