July 2018
Beginner
236 pages
5h 34m
English
We use several of these InputFields in the UserEnrollmentForm component. Note that the UserEnrollmentForm component is not an observer. Its purpose is to get hold of the store via the inject() decorator and pass it down to some of its child observer components. The inject() here uses the function-based argument, which is more type-safe than the string-based argument of inject('store'):
import React from 'react';import { inject } from 'mobx-react';import { Grid, TextField, Typography, } from '@material-ui/core';@inject(stores => ({ store: stores.store }))class UserEnrollmentForm extends React.Component { render() { const { store } = this.props; return ( <form> <Grid container direction={'column'}> <CenteredGridItem ...
Read now
Unlock full access