Skip to content

Commit

Permalink
make number or string, fix || to ??
Browse files Browse the repository at this point in the history
  • Loading branch information
milkman4 committed Dec 11, 2024
1 parent 2981cc5 commit 8af034d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class DayColumn extends React.Component {
return styledEvents.map(({ event, style }, idx) => {
let end = accessors.end(event)
let start = accessors.start(event)
let key = accessors.eventId(event) || 'evt_' + idx
let key = accessors.eventId(event) ?? 'evt_' + idx
let format = 'eventTimeRangeFormat'
let label

Expand Down
4 changes: 2 additions & 2 deletions stories/props/eventIdAccessor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Canvas, Story } from '@storybook/addon-docs'

# eventIdAccessor

- type: `string | function (event: Object) => string`
- type: `string | number | function (event: Object) => string | number`
- default: 'id'

The id of the event. Must resolve to a string. Used as the key for the event in the DOM. If not provided, the event will be given a key of 'evt\_<index>'.
The id of the event. Must resolve to a string or number. Used as the key for the event in the DOM. If not provided, the event will be given a key of 'evt\_{index}'.

<Story id="props--event-id-accessor" />

0 comments on commit 8af034d

Please sign in to comment.