I want to use Mobx ViewModel (from mobx-utils) in a functional component in React. Well, My model in this case is a state. (e.g - company in the next line):
const [company, setCompany] = useState(store.companyObservable)
And according to that, the initial of the view model will be look like this:
const vm = createViewModel(company);
And the use of it in the template will look like this:
<Input
value={vm.name}
onChange={e => vm.name = e.target.value }
/>
But in this way, Even though that the initial value will get in to the input. The input now not editable. Which is quite understandable because he is not in state.
So, how can I implement this thing in the right way?