react native 0.63.5 library development yarn symlink always hard/full reload app even small change – not hot reload work.
I tried
* node_modoules remove and install
* rm -rf ~/.config/yarn/link/*
* watchman watch-del-all
* rm -rf .git/index.lock
* restart devices
package.json
{
"name": "TestProject",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"android:dev": "yarn android & adb reverse tcp:8081 tcp:8081",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"check-code": "prettier --check miniApps/* && eslint miniApps/**/*.{ts,tsx} --max-warnings=0",
"code-format": "prettier --loglevel warn --write miniApps/*",
"storybook": "start-storybook -p 7007",
"build-storybook": "build-storybook",
"buildMiniApp": "plop"
},
"dependencies": {
"@eva-design/eva": "^2.0.0",
"@react-native-community/async-storage": "^1.10.0",
"@react-native-community/cli-platform-android": "^12.3.6",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/progress-bar-android": "^1.0.4",
"@react-native-firebase/app": "^14.7.0",
"@react-native-firebase/messaging": "^14.7.0",
"@react-navigation/drawer": "^5.8.4",
"@react-navigation/native": "^5.4.0",
"@react-navigation/stack": "^5.3.7",
"@sentry/react-native": "^1.4.5",
"@twotalltotems/react-native-otp-input": "^1.3.11",
"@ui-kitten/components": "^5.0.0",
"@ui-kitten/eva-icons": "^5.0.0",
"add": "^2.0.6",
"ajv": "^7.1.0",
"appcenter": "^3.0.3",
"appcenter-analytics": "^3.0.3",
"appcenter-crashes": "^3.0.3",
"axios": "^0.19.2",
"i18n-js": "^3.5.1",
"lodash": "^4.17.15",
"moment": "^2.27.0",
"react": "16.13.1",
"react-native": "0.63.5",
"react-native-camera": "^3.26.0",
"react-native-config": "^1.4.1",
"react-native-countdown-component": "^2.7.1",
"react-native-device-info": "^5.5.7",
"react-native-dropdownalert": "^4.2.1",
"react-native-extra-dimensions-android": "^1.2.5",
"react-native-floating-action": "^1.21.0",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-image-resizer": "^1.4.5",
"react-native-input-spinner": "^1.2.10",
"react-native-localize": "^1.4.0",
"react-native-modal": "^11.5.6",
"react-native-network-logger": "^1.13.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-svg": "^6.0.6",
"react-native-reanimated": "^1.8.0",
"react-native-restart": "^0.0.17",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.7.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "^12.1.0",
"react-native-track-player": "^2.1.3",
"react-native-uuid": "^2.0.2",
"react-native-vector-icons": "^6.6.0",
"uuidv4": "^6.2.12",
"yarn": "^1.22.4",
"@react-native-community/slider": "4.2",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-linear-gradient": "^2.8.3"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": "^1.0.0",
"@storybook/addon-actions": "^5.3",
"@storybook/addon-knobs": "^5.3",
"@storybook/addon-links": "^5.3",
"@storybook/addon-ondevice-actions": "^5.3.23",
"@storybook/addon-ondevice-knobs": "^5.3.23",
"@storybook/react-native": "^5.3.23",
"@storybook/react-native-server": "^5.3.23",
"@testing-library/jest-native": "^3.4.3",
"@testing-library/react-native": "^7.0.2",
"@types/i18n-js": "^3.0.3",
"@types/jest": "^24.0.24",
"@types/lodash": "^4.14.150",
"@types/moment": "^2.13.0",
"@types/qs": "^6.9.5",
"@types/react-native": "^0.62.0",
"@types/react-native-honeywell-scanner": "^1.0.0",
"@types/react-native-input-spinner": "^1.2.0",
"@types/react-native-qrcode": "^0.2.2",
"@types/react-native-snap-carousel": "^3.8.5",
"@types/react-native-vector-icons": "^6.4.6",
"@types/react-test-renderer": "16.9.2",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"babel-jest": "^25.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-module-resolver": "^4.0.0",
"eslint": "^6.5.1",
"faker": "^5.4.0",
"husky": "^4.3.0",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"plop": "^3.0.5",
"prettier": "^2.0.4",
"qs": "^6.9.4",
"react-dom": "16.13.1",
"react-test-renderer": "16.13.1",
"typescript": "^3.8.3"
},
"jest": {
"preset": "./jest/jest-preset.js",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"setupFilesAfterEnv": [
"@testing-library/jest-native/extend-expect"
],
"setupFiles": [
"./jest/setup.js",
"./node_modules/react-native-gesture-handler/jestSetup.js"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|@react-native-community|@react-navigation)"
],
"testPathIgnorePatterns": []
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
},
"husky": {
"hooks": {
"pre-push": "yarn check-code"
}
}
}
metro.config.js
const path = require('path');
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
// path of react native library project
watchFolders: [path.resolve(__dirname, '../../../sc-mobile-design-system/packages')],
};
```js
bable.consig.js
module.exports = {
presets: [‘module:metro-react-native-babel-preset’],
plugins: [
[
‘module-resolver’,
{
root: [‘./’],
alias: {
‘@miniApps’: ‘./miniApps’,
‘@components’: ‘./components’,
‘@theme’: ‘./theme’,
‘@screens’: ‘./screens’,
‘@context’: ‘./context’,
‘@i18n’: ‘./i18n’,
‘@services’: ‘./services’,
‘@types’: ‘./types’,
‘@utils’: ‘./utils’,
‘@svgs’: ‘./SVGs’,
‘@fbnInbound’: ‘./miniApps/FBNInbound’,
‘@hooks’: ‘./hooks’,
‘@fbnManifest’: ‘./miniApps/FBNManifest’,
‘@nimInboundPutaway’: ‘./miniApps/NIMInboundPutaway’,
‘@fbnSortition’: ‘./miniApps/FBNSortition’,
‘@fbnPicking’: ‘./miniApps/FBNPicking’,
‘@fbnReplenishment’: ‘./miniApps/FBNReplenishment’,
‘@ndr’: ‘./miniApps/Ndr’
},
},
],
],
};