Skip to content

Commit 8e952a0

Browse files
authored
feat: remove nanoid (#321)
1 parent 023039a commit 8e952a0

File tree

7 files changed

+24
-91
lines changed

7 files changed

+24
-91
lines changed

package-lock.json

Lines changed: 20 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"main": "lib/cjs/index.js",
66
"typings": "lib/types/index.d.ts",
77
"module": "lib/esm/index.js",
8-
"sideEffects": [
9-
"lib/esm/polyfills.js",
10-
"lib/cjs/polyfills.js"
11-
],
128
"scripts": {
139
"clean": "rm -rf lib",
1410
"build": "npm run clean && npm run build:cjs && npm run build:esm",
@@ -137,7 +133,6 @@
137133
"@types/react-select": "^4.0.18",
138134
"@types/styled-system": "^5.1.9",
139135
"date-fns": "^2.11.1",
140-
"nanoid": "^3.1.23",
141136
"react-popper": "^2.3.0",
142137
"react-tether": "^2.0.7",
143138
"react-transition-group": "^4.3.0",

src/components/Datepicker/Month.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useMonth, FirstDayOfWeek } from '@datepicker-react/hooks';
33
import styled from 'styled-components';
44
import { format } from 'date-fns';
55

6-
import { generateId } from '../../utils/ids';
76
import { Colors } from '../../essentials';
87
import { Text } from '../Text/Text';
98
import { Day } from './Day';
@@ -57,12 +56,14 @@ const Month: FC<MonthProps> = ({ year, month, firstDayOfWeek, locale }: MonthPro
5756
))}
5857
</Weekdays>
5958
<DaysContainer>
60-
{days.map(day => {
59+
{days.map((day, index) => {
6160
if (typeof day === 'object') {
6261
return <Day date={day.date} key={day.date.toString()} dayLabel={day.dayLabel} />;
6362
}
6463

65-
return <div key={generateId()} />;
64+
// we can use index as a key since the array is never reordered
65+
// eslint-disable-next-line react/no-array-index-key
66+
return <div key={index} />;
6667
})}
6768
</DaysContainer>
6869
</div>

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import './polyfills';
2-
31
export * from './components';
42
export * from './essentials';
53
export * from './icons';

src/polyfills.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/utils/__mocks__/ids.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/utils/ids.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)