New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-enroute

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-enroute

Simple and fast React Native router based on react-enroute and native navigation

latest
Source
npmnpm
Version
8.0.1
Version published
Maintainers
1
Created
Source

React Native Enroute

Simple and fast React Native router based on react-enroute and native navigation

NPM version

To be honest it is not real router at all. This package contains some wrappers for using react-enroute with react-native-screens. Library plays well with Redux and MobX.

Usage

yarn add react-native-enroute react-enroute react-native-screens @react-navigation/native @react-navigation/native-stack
import {Router} from 'react-enroute'
import {State, createStack} from 'react-native-enroute'
import {ThemeProvider, PreventRemoveProvider} from '@react-navigation/core'
import {DefaultTheme} from '@react-navigation/native'

function Routes({
  location,
  paths,
  onNavigateBack,
}) {
  const ShopTab = createStack({paths, onNavigateBack})
  const QuestTab = createStack({paths, onNavigateBack})

  return (
    <ThemeProvider value={DefaultTheme}>
	    <PreventRemoveProvider>
				<Router {...{location}}>
					<ShopTab path='/shops'>
						<ShopList/>
						<Shop path=':id'/>
					</ShopTab>
					<QuestTab path='/quest'>
						<AllQuestions/>
						<Question path=':id'/>
					</QuestTab>
				</Router>
			</PreventRemoveProvider>
		</ThemeProvider>
  )
}

function App() {
  const routerState = useMemo(() => new State('/shops'), [])
  const pop = useCallback(() => {
    routerState.pop()
    return true
  }, [])
  
  const openShop123 = useCallback(() => {
    routerState.push('/shops/123')
  }, [])
  const resetToQuest1 = useCallback(() => {
    routerState.reset('/quest/1')
  }, []) 

  useEffect(() => {
    BackHandler.addEventListener('hardwareBackPress', pop)

    return () => {
      BackHandler.removeEventListener('hardwareBackPress', pop)
    }
  }, [])

  return (
    <View>
      <Button onPress={openShop123}/>
      <Button onPress={resetToQuest1}/>
      <Routes
        location={routerState.current}
        paths={routerState.paths}
        onNavigateBack={pop}
      />
    </View>
  )
}

Keywords

react-native

FAQs

Package last updated on 18 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts