Created
March 8, 2017 17:34
-
-
Save mtt87/90d57c02dd2621767ff2346a4b3ce642 to your computer and use it in GitHub Desktop.
big calendar docs: http://intljusticemission.github.io/react-big-calendar/examples/index.html#prop-components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import BigCalendar from 'react-big-calendar'; | |
import SingleEvent from './SingleEvent'; | |
// THIS WORKS | |
const Calendar = ({ refreshData }) => | |
... | |
<BigCalendar | |
components={{ | |
eventWrapper: SingleEvent, | |
}} | |
/> | |
... | |
// NOT WORKING | |
const Calendar = ({ refreshData }) => | |
... | |
<BigCalendar | |
components={{ | |
eventWrapper: <SingleEvent refreshData={refreshData} />, | |
}} | |
/> | |
... | |
// NOT WORKING | |
const Calendar = ({ refreshData }) => | |
... | |
<BigCalendar | |
components={{ | |
eventWrapper: React.cloneElement(SingleEvent, { refreshData: refreshData }), | |
}} | |
/> | |
... | |
// WORKING! | |
const Calendar = ({ refreshData }) => { | |
const SingleEventWrapped = () => <SingleEvent />; | |
return ( | |
... | |
<BigCalendar | |
components={{ | |
eventWrapper: SingleEventWrapped, | |
}} | |
/> | |
... | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment