Skip to content

Closes #269 : make dot children prop optional #276

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

Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ A Dot component is a HTML button. Dots directly correlate to slides. Clicking

| property | type | default | required | purpose |
| -------- | ---- | ------- | -------- | ------- |
| **children** | [string|node] | | **Yes** | Children is a special React property. Basically, the Dot component needs to wrap other components and/or JSX |
| children | [string|null|node] | null | No | Children is a special React property. Basically, the Dot component wraps other components and/or JSX |
| className | [string|null] | null | No | Optional className string that will be appended to the component's className string. |
| disabled | [boolean|null] | null | No | Null means Dot will automatically determine if this button is disabled. Setting this to true will force the button to be disabled. Setting this to false will prevent the button from ever being disabled. |
| onClick | [function|null] | null | No | Optional callback function that is called after the internal onClick function is called. It is passed the React synthetic event |
Expand Down
3 changes: 2 additions & 1 deletion src/Dot/Dot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import s from './Dot.scss';
const Dot = class Dot extends React.Component {
static propTypes = {
carouselStore: PropTypes.object.isRequired,
children: CarouselPropTypes.children.isRequired,
children: CarouselPropTypes.children,
className: PropTypes.string,
currentSlide: PropTypes.number.isRequired,
disabled: PropTypes.bool,
Expand All @@ -18,6 +18,7 @@ const Dot = class Dot extends React.Component {
}

static defaultProps = {
children: null,
className: null,
disabled: null,
onClick: null,
Expand Down
2 changes: 1 addition & 1 deletion typings/carouselElements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ declare const DotGroup: DotGroupInterface


interface DotProps {
readonly children: React.ReactChild
readonly children?: React.ReactChild
readonly className?: string
readonly disabled?: boolean
readonly onClick?: () => void
Expand Down