useApp hook
The useApp hook is a custom React hook that returns the application data, including the schema, pages, and other relevant information.
Example usage:
jsx
import { Page, useApp } from '@kottster/react';
export default () => {
const { stage } = useApp();
return (
<Page>
App is Running in Stage: {stage}
</Page>
);
};Returned values
- stage:
"production" | "development"- The current stage of the application. - schema:
ClientAppSchema- The overall schema of the app. - roles:
ClientIdentityProviderRole[]- An array of roles defined in the application.