When i install my test react native package to another project then project crashes and nothing see in console.
I install using “yarn add path/to/package”
react native test package
package.json file
{
"name": "project-react-mvc",
"version": "0.1.0",
"description": "REACT MVC Library",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"react-native": "src/index.js",
"source": "src/index.js",
"files": [
"src",
"lib",
"android",
"ios",
"cpp",
"*.podspec",
"!lib/typescript/example",
"!ios/build",
"!android/build",
"!android/gradle",
"!android/gradlew",
"!android/gradlew.bat",
"!android/local.properties",
"!**/__tests__",
"!**/__fixtures__",
"!**/__mocks__",
"!**/.*"
],
"scripts": {
"test": "jest",
"typecheck": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"prepack": "bob build",
"release": "release-it",
"example": "yarn --cwd example",
"bootstrap": "yarn example && yarn install"
},
"keywords": [
"react-native",
"ios",
"android"
],
"repository": "https://github.com/kriit24/project-react-mvc",
"author": "Kuno Vaik <[email protected]> (https://github.com/kriit24)",
"license": "MIT",
"bugs": {
"url": "https://github.com/kriit24/project-react-mvc/issues"
},
"homepage": "https://github.com/kriit24/project-react-mvc#readme",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.0.2",
"@evilmartians/lefthook": "^1.2.2",
"@react-native-community/eslint-config": "^3.0.2",
"@release-it/conventional-changelog": "^5.0.0",
"@types/jest": "^28.1.2",
"@types/react": "~17.0.21",
"@types/react-native": "0.70.0",
"commitlint": "^17.0.2",
"del-cli": "^5.0.0",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"pod-install": "^0.1.0",
"prettier": "^2.0.5",
"react": "18.2.0",
"react-native": "0.72.4",
"react-native-builder-bob": "^0.20.0",
"release-it": "^15.0.0",
"typescript": "^5.0.2"
},
"resolutions": {
"@types/react": "17.0.21"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
},
"engines": {
"node": ">= 16.0.0"
},
"packageManager": "^[email protected]",
"jest": {
"preset": "react-native",
"isolatedModules": true,
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?|@rneui|expo(-.*)?|@expo(-.*)?/.)/)"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"release-it": {
"git": {
"commitMessage": "chore: release ${version}",
"tagName": "v${version}"
},
"npm": {
"publish": true
},
"github": {
"release": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular"
}
}
},
"eslintConfig": {
"root": true,
"extends": [
"@react-native-community",
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
]
}
},
"eslintIgnore": [
"node_modules/",
"lib/"
],
"prettier": {
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
},
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module"
]
},
"dependencies": {
"@shopify/flash-list": "^1.5.0",
"create-react-class": "^15.7.0",
"expo-image-picker": "~14.3.2",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-vector-icons": "^10.0.0",
"react-test-renderer": "^18.2.0"
}
}
src/index.js file
import { ProjectReact, App } from './component/project.react';
import Loader from './helper/loader';
const Project = {
React: ProjectReact,
};
export { Project, App, Loader };
src/helper/loader.js file
import React from 'react';
import { View, ActivityIndicator } from 'react-native';
import css from '../assets/style';
export default function Loader(props) {
return null;
}
src/assets/style.js file
import { StyleSheet, Dimensions, Platform } from 'react-native';
const css = StyleSheet.create({
});
export default css;
when i comment out in “src/helper/loader.js” line “import css from ‘../assets/style’;” then everything works, othervise not, what can be wrong in “src/assets/style.js” file ?
when i run jest test then everything is ok.
But whn i install and import then app crashes.