Skip to content

Commit

Permalink
[Tabs] Update onChange docs to match types (#15672)
Browse files Browse the repository at this point in the history
* [Tab]s Update onChange signature to match docs

Changed the value from any to number to match the documentation at https://material-ui.com/api/tabs/

* Sebastian review
  • Loading branch information
jharrilim authored and eps1lon committed May 18, 2019
1 parent ffffcb2 commit 997a8b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/material-ui/src/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ Tabs.propTypes = {
* Callback fired when the value changes.
*
* @param {object} event The event source of the callback
* @param {number} value We default to the index of the child
* @param {any} value We default to the index of the child (number)
*/
onChange: PropTypes.func,
/**
Expand Down
2 changes: 1 addition & 1 deletion pages/api/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Tabs from '@material-ui/core/Tabs';
| <span class="prop-name">component</span> | <span class="prop-type">elementType</span> | <span class="prop-default">'div'</span> | The component used for the root node. Either a string to use a DOM element or a component. |
| ~~<span class="prop-name">fullWidth</span>~~ | <span class="prop-type">bool</span> | | *Deprecated*. Instead, use the `variant="fullWidth"` property.<br><br>If `true`, the tabs will grow to use all the available space. This property is intended for small views, like on mobile. |
| <span class="prop-name">indicatorColor</span> | <span class="prop-type">enum:&nbsp;'secondary'&nbsp;&#124;<br>&nbsp;'primary'<br></span> | <span class="prop-default">'secondary'</span> | Determines the color of the indicator. |
| <span class="prop-name">onChange</span> | <span class="prop-type">func</span> | | Callback fired when the value changes.<br><br>**Signature:**<br>`function(event: object, value: number) => void`<br>*event:* The event source of the callback<br>*value:* We default to the index of the child |
| <span class="prop-name">onChange</span> | <span class="prop-type">func</span> | | Callback fired when the value changes.<br><br>**Signature:**<br>`function(event: object, value: any) => void`<br>*event:* The event source of the callback<br>*value:* We default to the index of the child (number) |
| ~~<span class="prop-name">scrollable</span>~~ | <span class="prop-type">bool</span> | | *Deprecated*. Instead, use the `variant="scrollable"` property.<br><br>If `true`, it will invoke scrolling properties and allow for horizontally scrolling (or swiping) of the tab bar. |
| <span class="prop-name">ScrollButtonComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">TabScrollButton</span> | The component used to render the scroll buttons. |
| <span class="prop-name">scrollButtons</span> | <span class="prop-type">enum:&nbsp;'auto'&nbsp;&#124;<br>&nbsp;'on'&nbsp;&#124;<br>&nbsp;'off'<br></span> | <span class="prop-default">'auto'</span> | Determine behavior of scroll buttons when tabs are set to scroll `auto` will only present them on medium and larger viewports `on` will always present them `off` will never present them |
Expand Down

0 comments on commit 997a8b5

Please sign in to comment.