Skip to content

Instantly share code, notes, and snippets.

@mykltronn
Created June 11, 2019 19:29
Show Gist options
  • Save mykltronn/0f5f380395f079c5be1bc60ac885e96b to your computer and use it in GitHub Desktop.
Save mykltronn/0f5f380395f079c5be1bc60ac885e96b to your computer and use it in GitHub Desktop.
import React from 'react';
import {
View,
TouchableOpacity,
Text,
NativeModules
} from "react-native";
const Test = props => {
const fail = () => {
// NativeModules exposes our package!
// Our package exposes our @ReacMethod annotated methods!
NativeModules.ImmersiveMode.fail();
}
return (
<View style={{ flex: 1 }}>
<TouchableOpacity
style={{ backgroundColor: "red", width: 100, height: 50}}
onPress={fail}>
<Text>Fail</Text>
</TouchableOpacity>
</View>
);
};
export default Test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment