hfour / h4bff

H4's backend & frontend framework :cupid::wrench: https://hfour.github.io/h4bff/
MIT License
7 stars 2 forks source link

Add application context provider to router #41

Closed spion closed 5 years ago

spion commented 5 years ago

Use the AppContext.Consumer to get the application within a component. This enables the use of app.getSingleton within e.g. page layouts

<AppContext.Consumer>
  {context => context.app.getSingleton(NameSingleton).appName}
</AppContext.Consumer>