m
Size: a a a
m
ВП
S
const Example = inject("myStore")(observer((props) => {
// ...
}));
ВП
АК
IS
АК
IS
MK
АК
IS
MK
K
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();
export default history;
<BrowserRouter history={history}>
<GuardProvider guards={[requireLogin]} loading={Loading} error={NotFoundPage}>
{children(
<Switch>
<GuardedRoute
path="/register"
exact
component={() => AuthContainer({children: RegisterPage()})}
meta={{ auth: false }}
/>
<GuardedRoute path="/login" exact component={() => AuthContainer({children: AuthPage()})} meta={{ auth: false }}
/>
<GuardedRoute path="/pro" exact component={() => DefaultContainer({children: ProPage(), classes: 'page-pro'})} meta={{ auth: true }} />``
<GuardedRoute path="/" exact component={() => DefaultContainer({children: TaskListPage()})} meta={{ auth: true }} />
<GuardedRoute path="/task/:id" exact component={() => DefaultContainer({children: TaskInfoPage()})} meta={{ auth: true }} />
<GuardedRoute path="/history" exact component={() => DefaultContainer({children:HistoryPage()})} meta={{ auth: true }} />
<GuardedRoute path="*" component={() => DefaultContainer({children: NotFoundPage()})} />
</Switch>
)}
</GuardProvider>
<Tabbar/>
</BrowserRouter>
A
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();
export default history;
<BrowserRouter history={history}>
<GuardProvider guards={[requireLogin]} loading={Loading} error={NotFoundPage}>
{children(
<Switch>
<GuardedRoute
path="/register"
exact
component={() => AuthContainer({children: RegisterPage()})}
meta={{ auth: false }}
/>
<GuardedRoute path="/login" exact component={() => AuthContainer({children: AuthPage()})} meta={{ auth: false }}
/>
<GuardedRoute path="/pro" exact component={() => DefaultContainer({children: ProPage(), classes: 'page-pro'})} meta={{ auth: true }} />``
<GuardedRoute path="/" exact component={() => DefaultContainer({children: TaskListPage()})} meta={{ auth: true }} />
<GuardedRoute path="/task/:id" exact component={() => DefaultContainer({children: TaskInfoPage()})} meta={{ auth: true }} />
<GuardedRoute path="/history" exact component={() => DefaultContainer({children:HistoryPage()})} meta={{ auth: true }} />
<GuardedRoute path="*" component={() => DefaultContainer({children: NotFoundPage()})} />
</Switch>
)}
</GuardProvider>
<Tabbar/>
</BrowserRouter>
ИС
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();
export default history;
<BrowserRouter history={history}>
<GuardProvider guards={[requireLogin]} loading={Loading} error={NotFoundPage}>
{children(
<Switch>
<GuardedRoute
path="/register"
exact
component={() => AuthContainer({children: RegisterPage()})}
meta={{ auth: false }}
/>
<GuardedRoute path="/login" exact component={() => AuthContainer({children: AuthPage()})} meta={{ auth: false }}
/>
<GuardedRoute path="/pro" exact component={() => DefaultContainer({children: ProPage(), classes: 'page-pro'})} meta={{ auth: true }} />``
<GuardedRoute path="/" exact component={() => DefaultContainer({children: TaskListPage()})} meta={{ auth: true }} />
<GuardedRoute path="/task/:id" exact component={() => DefaultContainer({children: TaskInfoPage()})} meta={{ auth: true }} />
<GuardedRoute path="/history" exact component={() => DefaultContainer({children:HistoryPage()})} meta={{ auth: true }} />
<GuardedRoute path="*" component={() => DefaultContainer({children: NotFoundPage()})} />
</Switch>
)}
</GuardProvider>
<Tabbar/>
</BrowserRouter>
K
ИС
K
useEffect(() => {
fetchStories()
}, [])
K