How to use 'react native gitignore' in JavaScript

Every line of 'react native gitignore' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
26function nativeReactInstall() {
27 if (!fs.existsSync(reactNativePath)) {
28 return
29 }
30 console.log('living in a react native world', reactVersion);
31 var reactVersion = require(path.join(reactNativePath, 'package.json')).version;
32
33
34 writeJSON('../package.json.' + Date.now(), pkg);
35
36
37 pkg.devDependencies = {};
38 delete pkg.peerDependencies.react;
39 pkg.peerDependencies["react-native"] = reactVersion;
40
41 pkg.main = "src/index"
42
43 writeJSON('../package.json', pkg);
44 write('../src/react.js', 'module.exports = require("react-native");\n');
45 if (fs.existsSync(reactPath)) {
46 console.log('removing non native react', reactPath);
47 deleteFolderRecursive(reactPath);
48 }
49}

Related snippets