# Function appContextFeature

- appContextFeature(options?): SubAppFeatureFactory

- Add support for react app context to a subapp

  #### Parameters

  - options: AppContextFeatureOptions = {}

    app context feature options

  #### Returns SubAppFeatureFactory

  subapp feature factory for app context

  #### Remark

  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()],
      };

  - Defined in packages/xarc-react/src/node/feat-app-context-node.tsx:44