How to use the react-native-windows.RootInputViewWindows function in react-native-windows

To help you get started, we’ve selected a few react-native-windows examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / reactxp / src / windows / RootView.tsx View on Github external
import {
    BaseRootView,
    BaseRootViewProps,
    RootView as RootViewBase,
    RootViewPropsWithMainViewType,
    RootViewState,
    RootViewUsingProps as RootViewUsingPropsBase
} from '../native-desktop/RootView';

import { AccessibilityAnnouncer } from './AccessibilityAnnouncer';

//
// We use a custom RNW provided component to capture key input before being dispatched to native controls.
// If support not present, we fallback to the base class implementation.
const _isRootInputViewSupported = !!RNW.RootInputViewWindows;

const _styles = RN.StyleSheet.create({
    appWrapperStyle : {
        flex: 1
    }
});

type Handler = (e: RN.NativeSyntheticEvent) => void;

function _renderTopView(
    content: JSX.Element, onKeyDown: Handler, onKeyDownCapture: Handler, onKeyUp: Handler, onTouchStartCapture: Handler): JSX.Element {
    return (
        ) => {onKeyDownCapture(e); onKeyDown(e); } }
            onAccelKeyUp={ onKeyUp }