From 37181e4ca834feb23dd3c049f3b46abe780720ca Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Fri, 30 Jun 2017 08:00:02 -0700 Subject: [PATCH] fix(Tab): relax menuItem prop type --- .../Tab/Usage/TabExampleCustomMenuItem.js | 19 +++++++++++++++++++ docs/app/Examples/modules/Tab/Usage/index.js | 5 +++++ src/modules/Tab/Tab.js | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 docs/app/Examples/modules/Tab/Usage/TabExampleCustomMenuItem.js diff --git a/docs/app/Examples/modules/Tab/Usage/TabExampleCustomMenuItem.js b/docs/app/Examples/modules/Tab/Usage/TabExampleCustomMenuItem.js new file mode 100644 index 0000000000..4469f6bb23 --- /dev/null +++ b/docs/app/Examples/modules/Tab/Usage/TabExampleCustomMenuItem.js @@ -0,0 +1,19 @@ +import React from 'react' +import { Label, Menu, Tab } from 'semantic-ui-react' + +const panes = [ + { + menuItem: { key: 'users', icon: 'users', content: 'Users' }, + render: () => Tab 1 Content, + }, + { + menuItem: Messages, + render: () => Tab 2 Content, + }, +] + +const TabExampleCustomMenuItem = () => ( + +) + +export default TabExampleCustomMenuItem diff --git a/docs/app/Examples/modules/Tab/Usage/index.js b/docs/app/Examples/modules/Tab/Usage/index.js index 50857b69c8..63d78750bb 100644 --- a/docs/app/Examples/modules/Tab/Usage/index.js +++ b/docs/app/Examples/modules/Tab/Usage/index.js @@ -19,6 +19,11 @@ const TabUsageExamples = () => ( description='You can capture the tab change event.' examplePath='modules/Tab/Usage/TabExampleOnTabChange' /> + ) diff --git a/src/modules/Tab/Tab.js b/src/modules/Tab/Tab.js index 384eab9a1d..1d94d161d9 100644 --- a/src/modules/Tab/Tab.js +++ b/src/modules/Tab/Tab.js @@ -54,7 +54,7 @@ class Tab extends Component { * } */ panes: PropTypes.arrayOf(PropTypes.shape({ - menuItem: PropTypes.string.isRequired, + menuItem: customPropTypes.itemShorthand, render: PropTypes.func.isRequired, })), }