Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Enable jsx-key tslint rule",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "mark@thedutchies.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class ContextualMenuCustomizationExample extends React.Component<{}, {}>
<ul className='ms-ContextualMenu-customizationExample-categoriesList'>
<li className='ms-ContextualMenu-item'>
{ item.categoryList.map((category: any) =>
<button className='ms-ContextualMenu-link' role='menuitem'>
<button className='ms-ContextualMenu-link' role='menuitem' key={category.name}>
<div>
<span
className='ms-ContextualMenu-icon ms-ContextualMenu-customizationExample-categorySwatch'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
BaseComponent
} from '../../Utilities';
import { mergeStyles } from '../../Styling';
import { IOverflowSet, IOverflowSetProps } from './OverflowSet.types';
import { IOverflowSet, IOverflowSetProps, IOverflowSetItemProps } from './OverflowSet.types';
import { FocusZone, FocusZoneDirection } from '../../FocusZone';

import * as stylesImport from './OverflowSet.scss';
Expand Down Expand Up @@ -52,14 +52,12 @@ export class OverflowSet extends BaseComponent<IOverflowSetProps, {}> implements
}

@autobind
private _onRenderItems(items: any[]): JSX.Element[] {
private _onRenderItems(items: IOverflowSetItemProps[]): JSX.Element[] {
return items.map((item, i) => {
const wrapperDivProps: React.HTMLProps<HTMLDivElement> = { className: css('ms-OverflowSet-item', styles.item) };
if (item.key) {
wrapperDivProps.key = item.key;
}

return (
<div {...wrapperDivProps}>
<div key={ item.key } { ...wrapperDivProps }>
{ this.props.onRenderItem(item) }
</div>
);
Expand All @@ -70,7 +68,7 @@ export class OverflowSet extends BaseComponent<IOverflowSetProps, {}> implements
private _onRenderOverflowButtonWrapper(items: any[]): JSX.Element {
const wrapperDivProps: React.HTMLProps<HTMLDivElement> = { className: css('ms-OverflowSet-overflowButton', styles.item) };
return (
<div {...wrapperDivProps}>
<div { ...wrapperDivProps }>
{ this.props.onRenderOverflowButton(items) }
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class PeoplePickerTypesExample extends BaseComponent<any, IPeoplePickerEx
componentRef={ this._resolveRef('_picker') }
/>
<label> Click to Add a person </label>
{ controlledItems.map(item => <div>
{ controlledItems.map((item, index) => <div key={ index }>
<DefaultButton
className='controlledPickerButton'
// tslint:disable-next-line:jsx-no-lambda
Expand All @@ -299,7 +299,7 @@ export class PeoplePickerTypesExample extends BaseComponent<any, IPeoplePickerEx
});
} }
>
<Persona { ...item} />
<Persona { ...item } />
</DefaultButton>
</div>) }
</div>
Expand Down
1 change: 0 additions & 1 deletion packages/office-ui-fabric-react/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
],
"rules": {
"jsx-no-string-ref": false,
"jsx-key": false,
"jsx-boolean-value": false,
"jsx-ban-props": false,
"max-line-length": [
Expand Down