DEV Community

Discussion on: How to: mobx-state-tree + react + typescript

Collapse
 
brooksktm profile image
ktmBrooks

Great tutorial, reads very well and quite insightful.

have a quick question was hoping you could answer and I couldn't figure it out myself. I created a Functional component and wrapped it in the observer above like you did:

export const MyComponent = observer(() => {...}

I then inject my store with useStore(), if I had a prop on my store called 'name' to update its value do I need to create a setter action? Was hoping there would be a way to auto generate getters and setters for each store prop.

Again great tutorial!