app context feature options
subapp feature factory for app context
This is added by the declareSubApp API automatically.
Example:
import { ReactSubApp, appContextFeature, AppContext, React } from "@xarc/react";
const Sample = () => {
return (
<AppContext.Consumer>
{({ isSsr, ssr }) => {
if (isSsr) {
return <div>Server Side Rendering {ssr.request.url}</div>;
}
}}
</AppContext.Consumer>
);
};
export const subapp: ReactSubApp = {
Component: Sample,
wantFeatures: [appContextFeature()],
};
Add support for react app context to a subapp