GitXplorerGitXplorer
b

bs-react-native-modal

public
3 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
664d9b12878f87f466a06a3e926b22fffe294501

patch to v 0.1.1

bbroerjuang committed 6 years ago
Unverified
30d4c1813d6f07a6298396f334c387cbdf292ee7

update readme to fix installation package

bbroerjuang committed 6 years ago
Unverified
1eae25511c6f4eae890073fd166b51704474cb33

update readme and repo information

bbroerjuang committed 6 years ago
Unverified
c9843a2f1ddcabb9f95ea80ab6348977c8a65a58

complete biding of react-native-modal

bbroerjuang committed 6 years ago

README

The README file for this repository.

bs-react-native-modal

this is a binding of react-native-modal

Usage

see the rei for detail documentation

module ModalTester = {
  open BsReactNative;
  type state = {isModalVisible: bool};
  type action =
    | ToggleModal;

  let component = ReasonReact.reducerComponent("ModalTester");
  let make = _children => {
    ...component,
    initialState: () => {isModalVisible: false},
    reducer: (action, state) =>
      switch (action) {
      | ToggleModal =>
        ReasonReact.Update({isModalVisible: !state.isModalVisible})
      },
    render: self =>
      <View>
        <TouchableOpacity onPress={() => self.send(ToggleModal)}>
          <Text value="Show Modal" />
        </TouchableOpacity>
        <ReactNativeModal isVisible={self.state.isModalVisible}>
          <View>
            <Text value="Hello!" />
            <TouchableOpacity onPress={() => self.send(ToggleModal)}>
              <Text value="Hide Me" />
            </TouchableOpacity>
          </View>
        </ReactNativeModal>
      </View>,
  };
};

Installation

Use yarn or npm

$ yarn add bs-react-native-modal

Then update your bsconfig.json

{
  "bs-dependencies": ["bs-react-native-modal"]
}