Skip to content

Commit 5d1d32f

Browse files
fix: improve performance issues and remove depency on react-window
1 parent d61b642 commit 5d1d32f

File tree

11 files changed

+13194
-12666
lines changed

11 files changed

+13194
-12666
lines changed

example/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path');
22
const pak = require('../package.json');
33

4+
console.log({ pak });
45
module.exports = {
56
presets: ['module:metro-react-native-babel-preset'],
67
plugins: [

example/config-overrides.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,38 @@ const {
66
override,
77
removeModuleScopePlugin,
88
} = require('customize-cra');
9-
const { addReactRefresh } = require('customize-cra-react-refresh');
109

10+
const pak = require('../package.json');
1111
const path = require('path');
12-
12+
console.log({ name: pak.name, source: pak.source });
1313
module.exports = override(
14-
addReactRefresh(),
1514
fixBabelImports('module-resolver', {
1615
alias: {
1716
'^react-native$': 'react-native-web',
17+
18+
[pak.name]: path.join(__dirname, '..', pak.source),
19+
// react: '../node_modules/react',
20+
// 'react-dom': '../node_modules/react-dom',
21+
// 'create-react-class': '../node_modules/create-react-class',
22+
// 'react-native-web': '../node_modules/react-native-web',
1823
},
1924
}),
2025
addWebpackAlias({
2126
'react-native': 'react-native-web',
22-
27+
[pak.name]: path.join(__dirname, '..', pak.source),
28+
// react: '../node_modules/react',
29+
// 'react-dom': '../node_modules/react-dom',
30+
// 'create-react-class': '../node_modules/create-react-class',
31+
// 'react-native-web': '../node_modules/react-native-web',
2332
// here you can add extra packages
2433
}),
2534
babelInclude([
2635
path.resolve('src'),
2736
path.resolve('app.json'),
37+
38+
// any react-native modules you need babel to compile
2839
path.resolve('./node_modules/react-native-vector-icons'),
2940
path.resolve('../src'),
30-
// any react-native modules you need babel to compile
3141
]),
3242
removeModuleScopePlugin()
3343
);

example/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"web:build": "react-app-rewired build",
1212
"web:test": "react-app-rewired test",
1313
"web:eject": "react-app-rewired eject",
14-
"web": "npm link ../node_modules/react && react-app-rewired start"
14+
"web": "npm link ../node_modules/react --legacy-peer-deps --force && react-app-rewired start"
1515
},
1616
"dependencies": {
1717
"@formatjs/intl-datetimeformat": "^2.6.6",
@@ -22,13 +22,10 @@
2222
"@formatjs/intl-numberformat": "^5.6.1",
2323
"@formatjs/intl-pluralrules": "^3.4.6",
2424
"@formatjs/intl-relativetimeformat": "^7.2.6",
25-
"@testing-library/jest-dom": "^4.2.4",
26-
"@testing-library/react": "^9.3.2",
27-
"@testing-library/user-event": "^7.1.2",
28-
"react": "^16.13.1",
29-
"react-dom": "^16.13.1",
25+
"react": "^16.14.0",
26+
"react-dom": "^16.14.0",
3027
"react-native": "0.63.2",
31-
"react-native-localize": "^1.4.1",
28+
"react-native-localize": "^2.0.1",
3229
"react-native-vector-icons": "https://github.com/RichardLindhout/react-native-vector-icons",
3330
"react-native-web": "^0.14.8",
3431
"react-scripts": "3.4.3"

example/src/App.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ import {
2020
overlay,
2121
Paragraph,
2222
} from 'react-native-paper';
23+
2324
import {
2425
DatePickerModal,
2526
DatePickerModalContent,
2627
TimePickerModal,
27-
} from '../../src';
28+
// @ts-ignore
29+
} from 'react-native-paper-dates';
2830
import { addMonths } from '../../src/Date/dateUtils';
2931

3032
const baseDate = new Date();
@@ -94,9 +96,9 @@ function App({
9496
);
9597

9698
const onChangeExcludeRange = React.useCallback(
97-
({ excludedDates }: { excludedDates: Date[] }) => {
99+
(args: { excludedDates: Date[] }) => {
98100
setRangeExcludeOpen(false);
99-
setExcludedDates(excludedDates);
101+
setExcludedDates(args.excludedDates);
100102
},
101103
[setRangeExcludeOpen, setExcludedDates]
102104
);

0 commit comments

Comments
 (0)