How do I split my app into different screens
const { route } = this.props;
route.to('my-screen') const { route } = this.props;
route.to('my-screen', { myParam: 5 }) import { Routes, Route } from '@deskpro/apps-sdk-react';class App extends React.PureComponent {
static propTypes = {
/**
* Instance of the Deskpro App Sdk Client
*/
dpapp: PropTypes.object,
/**
* Instance of sdk router.
*/
route: PropTypes.object,
};
/**
* Show the authentication screen immediately after the component is mounted
*/
componentDidMount() {
const { route } = this.props;
route.to('auth');
}
/**
* @returns {*}
*/
render() {
return (
<Routes>
<Route location="auth" component={PageAuth} />
<Route location="home" component={PageHome} />
<Route defaultRoute>
<p>Loading</p>
</Route>
</Routes>
);
}
}Last updated