From 42e2a7154653d3f41318fed77566d7711e302071 Mon Sep 17 00:00:00 2001 From: Taylor Jones <tay1orjones@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:23:52 -0500 Subject: [PATCH] fix(switch): allow children to render (#11791) (#11796) * fix(switch): allow children to render * test(api): update public api snapshot --- packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap | 1 - .../components/ContentSwitcher/next/ContentSwitcher.stories.js | 2 +- packages/react/src/components/Switch/Switch.js | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 7d3099aaab9a..05603cde7717 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -6142,7 +6142,6 @@ Map { "onClick": [Function], "onKeyDown": [Function], "selected": false, - "text": "Provide text", }, "propTypes": Object { "children": Object { diff --git a/packages/react/src/components/ContentSwitcher/next/ContentSwitcher.stories.js b/packages/react/src/components/ContentSwitcher/next/ContentSwitcher.stories.js index 3190f27295f4..89ca579d6ff7 100644 --- a/packages/react/src/components/ContentSwitcher/next/ContentSwitcher.stories.js +++ b/packages/react/src/components/ContentSwitcher/next/ContentSwitcher.stories.js @@ -21,7 +21,7 @@ export default { export const Default = () => ( <ContentSwitcher onChange={() => {}}> <Switch name="one" text="First section" /> - <Switch name="two" text="Second section" /> + <Switch name="two">Second section</Switch> <Switch name="three" text="Third section" /> </ContentSwitcher> ); diff --git a/packages/react/src/components/Switch/Switch.js b/packages/react/src/components/Switch/Switch.js index d2ba2d2236b1..4fc4d7e93ea6 100644 --- a/packages/react/src/components/Switch/Switch.js +++ b/packages/react/src/components/Switch/Switch.js @@ -117,7 +117,6 @@ Switch.propTypes = { Switch.defaultProps = { selected: false, - text: 'Provide text', onClick: () => {}, onKeyDown: () => {}, };