From 6e2a519c8796958ff625190040a42247e8bcc421 Mon Sep 17 00:00:00 2001 From: Jan Hassel Date: Mon, 5 Oct 2020 19:43:28 +0200 Subject: [PATCH] fix(content-switcher): provide empty default onChange prop (#6945) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap | 1 + packages/react/src/components/ContentSwitcher/ContentSwitcher.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 47b7521bd713..cd04e3f10e91 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -749,6 +749,7 @@ Map { }, "ContentSwitcher" => Object { "defaultProps": Object { + "onChange": [Function], "selectedIndex": 0, "selectionMode": "automatic", }, diff --git a/packages/react/src/components/ContentSwitcher/ContentSwitcher.js b/packages/react/src/components/ContentSwitcher/ContentSwitcher.js index 5c22f95c1965..5b2f1b1c552f 100644 --- a/packages/react/src/components/ContentSwitcher/ContentSwitcher.js +++ b/packages/react/src/components/ContentSwitcher/ContentSwitcher.js @@ -60,6 +60,7 @@ export default class ContentSwitcher extends React.Component { static defaultProps = { selectedIndex: 0, selectionMode: 'automatic', + onChange: () => {}, }; static getDerivedStateFromProps({ selectedIndex }, state) {