How to use the react-router-native.withRouter function in react-router-native

To help you get started, we’ve selected a few react-router-native 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 flow-typed / flow-typed / definitions / npm / react-router-native_v4.x.x / flow_v0.53.x- / test_react-router-native.js View on Github external
const Unrouted: React$ComponentType<{|
  ...ContextRouter,
  someProp: string
|}&gt; = () =&gt; <span>;

const Routed1: React$ComponentType&lt;{| someProp: string |}&gt; = withRouter(
  Unrouted
);

// $ExpectError: This error bubbles up from the assignment in Routed2.
const Unrouted2: React$ComponentType&lt;{|
  ...ContextRouter,
  someProp: string
|}&gt; = () =&gt; <span>;

const Routed2: React$ComponentType&lt;{| someProp2: string |}&gt; = withRouter(
  Unrouted2
);
</span></span>
github flow-typed / flow-typed / definitions / npm / react-router-native_v4.x.x / flow_v0.53.x- / test_react-router-native.js View on Github external
});
const match3: null | Match = matchPath("/the/pathname");

// $ExpectError
matchPath();
// $ExpectError
const matchError: string = matchPath("/the/pathname", {
  path: "the/:dynamicId"
});

const Unrouted: React$ComponentType&lt;{|
  ...ContextRouter,
  someProp: string
|}&gt; = () =&gt; <span>;

const Routed1: React$ComponentType&lt;{| someProp: string |}&gt; = withRouter(
  Unrouted
);

// $ExpectError: This error bubbles up from the assignment in Routed2.
const Unrouted2: React$ComponentType&lt;{|
  ...ContextRouter,
  someProp: string
|}&gt; = () =&gt; <span>;

const Routed2: React$ComponentType&lt;{| someProp2: string |}&gt; = withRouter(
  Unrouted2
);
</span></span>
github shanhuiyang / TypeScript-MERN-Starter / client / src / Common / HeaderWithBack.tsx View on Github external
{
                            this.props.rightTextId ?
                             :
                            
                        }
                    
                 :
                {/* nothing but counterbalance */}
            }
        ;
    }
}

export default withRouter(HeaderWithBack);
github prisma-archive / react-native-fullstack-graphql / src / components / CreatePage.js View on Github external
this.props.mutate({variables: {description, imageUrl}})
      .then(() => {
        this.props.router.replace('/')
      })
  }
}

const addMutation = gql`
  mutation ($description: String!, $imageUrl: String!){
    createPost(description: $description, imageUrl: $imageUrl) {
      id
    }
  }
`

const PageWithMutation = graphql(addMutation)(withRouter(CreatePage))

export default PageWithMutation
github jaywcjlove / amac / src / App.js View on Github external
callback: () =&gt; Linking.openURL('https://github.com/jaywcjlove/awesome-mac'),
      }
    ]);
  }
  render() {
    return (
      
        
          
        
      
    );
  }
}

const RoutersContainer = withRouter(({ history: historyData, location }) =&gt; {
  const routerData = getRouterData();
  const BasicLayout = routerData['/'].component;
  const resetProps = {
    routerData,
    location,
    history: historyData,
  };

  return (
    
  );
});
github shanhuiyang / TypeScript-MERN-Starter / client / src / Article / ArticleItem.tsx View on Github external
;
    }
}

export default withRouter(connectPropsAndActions(ArticleItem));
github shanhuiyang / TypeScript-MERN-Starter / client / src / Nav / NavLink.tsx View on Github external
interface IStates {}

class NavLink extends React.Component {
    render(): any {
        return 
            
            
        ;
    }
}

export default withRouter(NavLink);
github textileio / photos / App / SB / views / SignUp / index.js View on Github external
/&gt;
              
            
          
          <footer>
            
            
              Sign In
            
          </footer>
        
      )
    }
}

export default withRouter(SignUp)
github Traviskn / react-router-native-stack / lib / Stack.js View on Github external
renderTitle={renderTitle}
          renderLeftSegment={renderLeftSegment}
          renderRightSegment={renderRightSegment}
          animationType={animationType}
          gestureEnabled={gestureEnabled}
          children={children}
          stackViewStyle={stackViewStyle}
          replaceTransitionType={replaceTransitionType}
          isAnimating={isAnimating}
        /&gt;
      
    );
  }
}

export default withRouter(Stack);
github textileio / photos / App / SB / app / router.js View on Github external
{/* }/&gt;*/}
      {/* }/&gt;*/}
      {/* }/&gt;*/}
       }/&gt;
      {/* }/&gt;*/}
    
  )
}

App.propTypes = {
  history: PropTypes.shape({
    push: PropTypes.func.isRequired
  }).isRequired
}

export default withRouter(App)

react-router-native

Declarative routing for React Native applications

MIT
Latest version published 1 day ago

Package Health Score

95 / 100
Full package analysis