How to use import with absolute paths with Expo and React Native?

Update: Expo v32.0.0 and up Expo init is creating a babel.config.js for you. Just add the plugins key to your babel.config.js file and add your alias. The env key is not needed anymore. module.exports = function(api) { api.cache(true) return { presets: [‘babel-preset-expo’], plugins: [ [ ‘module-resolver’, { alias: { assets: ‘./assets’, components: ‘./src/components’, modules: ‘./src/modules’, … Read more

Re-render component when navigating the stack with React Navigation

If you are using React Navigation 5.X, just do the following: import { useIsFocused } from ‘@react-navigation/native’ export default function App(){ const isFocused = useIsFocused() useEffect(() => { if(isFocused){ //Update the state you want to be updated } }, [isFocused]) } The useIsFocused hook checks whether a screen is currently focused or not. It returns … Read more

How to remove unwanted expo modules

To remove a package from your node_modules directory, on the command line, use the uninstall command. Include the scope of the package is scoped. Unscoped package npm uninstall –save <package_name> Scoped package npm uninstall –save <@scope/package_name> if need to know more about it then follow official Document here https://docs.npmjs.com/uninstalling-packages-and-dependencies#removing-a-local-package-from-the-packagejson-dependencies