diff --git a/src/VerticalTimeline.js b/src/VerticalTimeline.js index 0385d56..a946713 100644 --- a/src/VerticalTimeline.js +++ b/src/VerticalTimeline.js @@ -3,10 +3,10 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; const VerticalTimeline = ({ - animate, - className, - layout, - lineColor, + animate = true, + className = '', + layout = '2-columns', + lineColor = '#FFF', children, }) => { if (typeof window === 'object') { @@ -43,11 +43,4 @@ VerticalTimeline.propTypes = { lineColor: PropTypes.string, }; -VerticalTimeline.defaultProps = { - animate: true, - className: '', - layout: '2-columns', - lineColor: '#FFF', -}; - export default VerticalTimeline; diff --git a/src/VerticalTimelineElement.js b/src/VerticalTimelineElement.js index a805e7f..c3937b4 100644 --- a/src/VerticalTimelineElement.js +++ b/src/VerticalTimelineElement.js @@ -4,23 +4,26 @@ import classNames from 'classnames'; import { InView } from 'react-intersection-observer'; const VerticalTimelineElement = ({ - children, - className, - contentArrowStyle, - contentStyle, - date, - dateClassName, - icon, - iconClassName, - iconOnClick, - onTimelineElementClick, - iconStyle, - id, - position, - style, - textClassName, - intersectionObserverProps, - visible, + children = '', + className = '', + contentArrowStyle = null, + contentStyle = null, + date = '', + dateClassName = '', + icon = null, + iconClassName = '', + iconOnClick = null, + onTimelineElementClick = null, + iconStyle = null, + id = '', + position = '', + style = null, + textClassName = '', + intersectionObserverProps = { + rootMargin: '0px 0px -40px 0px', + triggerOnce: true, + }, + visible = false, }) => ( {({ inView, ref }) => ( @@ -109,27 +112,4 @@ VerticalTimelineElement.propTypes = { }), }; -VerticalTimelineElement.defaultProps = { - children: '', - className: '', - contentArrowStyle: null, - contentStyle: null, - icon: null, - iconClassName: '', - iconOnClick: null, - onTimelineElementClick: null, - iconStyle: null, - id: '', - style: null, - date: '', - dateClassName: '', - position: '', - textClassName: '', - visible: false, - intersectionObserverProps: { - rootMargin: '0px 0px -40px 0px', - triggerOnce: true, - }, -}; - export default VerticalTimelineElement;