Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 932 Bytes

NativeRouter.md

File metadata and controls

41 lines (28 loc) · 932 Bytes

<NativeRouter>

A <Router> for iOS and Android apps built using React Native.

import { NativeRouter } from "react-router-native";

<NativeRouter>
  <App />
</NativeRouter>;

getUserConfirmation: func

A function to use to confirm navigation.

import { Alert } from "react-native";

// This is the default behavior
const getConfirmation = (message, callback) => {
  Alert.alert("Confirm", message, [
    { text: "Cancel", onPress: () => callback(false) },
    { text: "OK", onPress: () => callback(true) }
  ]);
};

<NativeRouter getUserConfirmation={getConfirmation} />;

keyLength: number

The length of location.key. Defaults to 6.

<NativeRouter keyLength={12} />

children: node

A single child element to render.