Skip to content

Commit f98c738

Browse files
docs: correct invalid JavaScript syntax in examples
1 parent 74672c2 commit f98c738

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,10 @@ const twoSeconds = 2000
711711

712712
<TodayMarker>
713713
{({ styles, date }) =>
714-
// date is value of current date. Use this to render special styles for the marker
715-
// or any other custom logic based on date:
716-
// e.g. styles = {...styles, backgroundColor: isDateInAfternoon(date) ? 'red' : 'limegreen'}
717-
return <div style={styles} />
714+
// date is value of current date. Use this to render special styles for the marker
715+
// or any other custom logic based on date:
716+
// e.g. styles = {...styles, backgroundColor: isDateInAfternoon(date) ? 'red' : 'limegreen'}
717+
<div style={styles} />
718718
}
719719
</TodayMarker>
720720
```
@@ -737,9 +737,7 @@ const today = Date.now()
737737

738738
//custom renderer
739739
<CustomMarker date={today}>
740-
{({ styles, date }) =>
741-
return <div style={styles} />
742-
}
740+
{({ styles, date }) => <div style={styles} />}
743741
</CustomMarker>
744742

745743
// multiple CustomMarkers
@@ -769,10 +767,10 @@ Custom renderer for this marker. Ensure that you always pass `styles` to the roo
769767
//custom renderer
770768
<CursorMarker>
771769
{({ styles, date }) =>
772-
// date is value of current date. Use this to render special styles for the marker
773-
// or any other custom logic based on date:
774-
// e.g. styles = {...styles, backgroundColor: isDateInAfternoon(date) ? 'red' : 'limegreen'}
775-
return <div style={styles} />
770+
// date is value of current date. Use this to render special styles for the marker
771+
// or any other custom logic based on date:
772+
// e.g. styles = {...styles, backgroundColor: isDateInAfternoon(date) ? 'red' : 'limegreen'}
773+
<div style={styles} />
776774
}
777775
</CursorMarker>
778776
```
@@ -785,7 +783,7 @@ You need to include the `Timeline.css` file, either via static file reference or
785783

786784
## How can I have items with different colors?
787785

788-
Now you can use item renderer for rendering items with different colors [itemRenderer](https://github.com/namespace-ee/react-calendar-timeline#itemrenderer).
786+
Now you can use item renderer for rendering items with different colors [itemRenderer](https://github.com/namespace-ee/react-calendar-timeline#itemrenderer).
789787
Please refer to [examples](https://github.com/namespace-ee/react-calendar-timeline/tree/master/examples#custom-item-rendering) for a sandbox example
790788

791789
## How can I add a sidebar on the right?

0 commit comments

Comments
 (0)