Skip to content

Commit

Permalink
Some improvements to web navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiPl01 committed Jan 28, 2025
1 parent baa13a9 commit 67f294a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 1 addition & 5 deletions apps/common-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ function useNavigationState() {
>();

const updateNavigationState = useCallback((state?: NavigationState) => {
if (IS_WEB) {
localStorage.setItem(PERSISTENCE_KEY, JSON.stringify(state));
} else {
AsyncStorage.setItem(PERSISTENCE_KEY, JSON.stringify(state)).catch(noop);
}
AsyncStorage.setItem(PERSISTENCE_KEY, JSON.stringify(state)).catch(noop);
}, []);

useEffect(() => {
Expand Down
8 changes: 1 addition & 7 deletions apps/web-example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@ const escape = require('escape-string-regexp');
const projectRoot = __dirname;
// This can be replaced with `find-yarn-workspace-root`
const monorepoRoot = path.resolve(projectRoot, '../..');
const libraryRoot = path.resolve(monorepoRoot, './packages/react-native-reanimated');

const config = getDefaultConfig(projectRoot);
// 1. Watch all files within the monorepo
config.watchFolders = [monorepoRoot, libraryRoot];
config.watchFolders = [monorepoRoot];
// 2. Let Metro know where to resolve packages and in what order
// @ts-expect-error
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
];

config.resolver.extraNodeModules = {
...config.resolver.extraNodeModules,
'react-native-reanimated': path.resolve(libraryRoot, 'src'),
};

const hasReactNative = require.resolve('react-native/package.json', {
paths: [projectRoot],
});
Expand Down

0 comments on commit 67f294a

Please sign in to comment.