Skip to content

Commit

Permalink
Fixes props being ignored on ListItem (#1344)
Browse files Browse the repository at this point in the history
* Fixes #1343 props ignored in ListItem

* Ensure that styles are still being passed along
  • Loading branch information
msevestre authored and iRoachie committed Sep 11, 2018
1 parent df6b236 commit 64874ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/list/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const ANDROID_SECONDARY = 'rgba(0, 0, 0, 0.54)';

const renderText = (content, defaultProps, style) =>
renderNode(Text, content, {
...defaultProps,
style: [style, defaultProps && defaultProps.style],
});
const renderAvatar = content =>
Expand Down
1 change: 1 addition & 0 deletions src/list/__tests__/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe('ListItem component', () => {
const component = shallow(
<ListItem
title="title test"
titleProps={{ numberOfLines: 5 }}
subtitle="title test"
rightTitle="title"
titleStyle={{ backgroundColor: 'peru' }}
Expand Down
1 change: 1 addition & 0 deletions src/list/__tests__/__snapshots__/ListItem.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ exports[`ListItem component should render with title and subtitle 1`] = `
}
>
<TextElement
numberOfLines={5}
style={
Array [
Array [
Expand Down

0 comments on commit 64874ef

Please sign in to comment.