completion
This commit is contained in:
25
ioneapps-maagapp-ee31119a522d/hotfix/react-scrollview-fix.js
vendored
Normal file
25
ioneapps-maagapp-ee31119a522d/hotfix/react-scrollview-fix.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/* eslint-disable no-console */
|
||||
const fs = require('fs');
|
||||
|
||||
try {
|
||||
console.log('React spring scroll view fix...');
|
||||
const rootDir = process.cwd();
|
||||
|
||||
const file = `${rootDir}/node_modules/react-native-spring-scrollview/SpringScrollView.js`;
|
||||
const data = fs.readFileSync(file, 'utf8');
|
||||
const dataFix = 'react-native/Libraries/Components/TextInput/TextInputState';
|
||||
|
||||
if (data.indexOf(dataFix) !== -1) {
|
||||
// eslint-disable-next-line no-throw-literal
|
||||
throw '> Already fixed';
|
||||
}
|
||||
|
||||
const result = data.replace(
|
||||
/react-native\/lib\/TextInputState/g,
|
||||
dataFix,
|
||||
);
|
||||
fs.writeFileSync(file, result, 'utf8');
|
||||
console.log('> Done');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
Reference in New Issue
Block a user