Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wech 28/remove nanoid #321

Merged
merged 2 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 20 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"main": "lib/cjs/index.js",
"typings": "lib/types/index.d.ts",
"module": "lib/esm/index.js",
"sideEffects": [
"lib/esm/polyfills.js",
"lib/cjs/polyfills.js"
],
"scripts": {
"clean": "rm -rf lib",
"build": "npm run clean && npm run build:cjs && npm run build:esm",
Expand Down Expand Up @@ -137,7 +133,6 @@
"@types/react-select": "^4.0.18",
"@types/styled-system": "^5.1.9",
"date-fns": "^2.11.1",
"nanoid": "^3.1.23",
"react-popper": "^2.3.0",
"react-tether": "^2.0.7",
"react-transition-group": "^4.3.0",
Expand Down
7 changes: 4 additions & 3 deletions src/components/Datepicker/Month.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useMonth, FirstDayOfWeek } from '@datepicker-react/hooks';
import styled from 'styled-components';
import { format } from 'date-fns';

import { generateId } from '../../utils/ids';
import { Colors } from '../../essentials';
import { Text } from '../Text/Text';
import { Day } from './Day';
Expand Down Expand Up @@ -57,12 +56,14 @@ const Month: FC<MonthProps> = ({ year, month, firstDayOfWeek, locale }: MonthPro
))}
</Weekdays>
<DaysContainer>
{days.map(day => {
{days.map((day, index) => {
if (typeof day === 'object') {
return <Day date={day.date} key={day.date.toString()} dayLabel={day.dayLabel} />;
}

return <div key={generateId()} />;
// we can use index as a key since the array is never reordered
// eslint-disable-next-line react/no-array-index-key
return <div key={index} />;
})}
</DaysContainer>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import './polyfills';

export * from './components';
export * from './essentials';
export * from './icons';
Expand Down
8 changes: 0 additions & 8 deletions src/polyfills.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/utils/__mocks__/ids.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/utils/ids.ts

This file was deleted.