FaridSafi / react-native-gifted-form

📝 « One React-Native form component to rule them all »
MIT License
1.44k stars 214 forks source link

Is there a way to fully use this package without ExNavigator? #89

Open elie222 opened 7 years ago

elie222 commented 7 years ago

I'm looking to integrate with ExNavigation

Marquis-H commented 7 years ago

+1

okbody39 commented 7 years ago

+1

ngduc commented 7 years ago

+1 : It'd be great if we don't have to use ExNavigator, I'm using another navigator lib. Thanks.

ofaltins commented 7 years ago

WIP fork without ExNavigator here: https://github.com/ofaltins/react-native-gifted-form

Using the React Native Modal component instead of ExNavigator. Btw @elie222 the example is now running with Exponent - FYI just in case you're using it with ex-navigation.

tharindu991 commented 7 years ago

+1

jonmountjoy commented 6 years ago

I managed to rip out ExNavigator and replace it with React Navigation, without modifying the core components. (It would have been much neater and cleaner if I did).

It wasn't too bad - the only problem is React Navigation doesn't have dynamic routes, so I needed a special, parameterised screen for all the modals. My basic navigator looks like this:

const RootNavigation = StackNavigator({
  DemoScreen: {
    screen: Example
  },
  MyModal: {
    screen: MyModal
  }
});

I then define the modal component:

class MyModal extends React.Component {
  static navigationOptions = ({ navigation }) => {
    return {
      title: navigation.getParam('getTitle')(),
      headerLeft: (
        <Button
          onPress={() => {
            navigation.getParam('onClose')(null, navigation);
          }}
          title='Back'
        />
      ),
      headerRight: (
        <Button
          onPress={() => {
            navigation.getParam('onClose')(null, navigation);
          }}
          title='Save'
        />
      )
    };
  };

  render() {
    return this.props.navigation.getParam('renderScene')();
  }
}

and make sure I use it by modifying the prop on GiftedForm:

openModal={route => {
          this.props.navigation.push('MyModal', route);
        }}

You can find the complete modification of the example app here.

Q8hma commented 5 years ago

WIP fork without ExNavigator here: https://github.com/ofaltins/react-native-gifted-form

Using the React Native Modal component instead of ExNavigator. Btw @elie222 the example is now running with Exponent - FYI just in case you're using it with ex-navigation.

hello

how to move from original or to you edit ?

thnx