Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed deprecated prop returnfullParser #13

Merged
merged 1 commit into from
Oct 14, 2018
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
14 changes: 1 addition & 13 deletions src/UserAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import availableProps from './availableProps'

const UserAgent = (
{children, returnFullParser, returnfullParser, ...props},
{children, returnFullParser, ...props},
{ua}
) => {
const validProps = Object.keys(props).filter(
Expand All @@ -22,16 +22,6 @@ const UserAgent = (
return null
}
if (funcChildren) {
if (returnfullParser) {
if (process.env.NODE_ENV !== 'production') {
const str =
'@quentin-sommer/react-useragent: You are using the deprecated prop `returnfullParser`.' +
' It will be removed in versions >=2.0.0.' +
' Replace it by the new `returnFullParser` to remove this message'
console.warn(str)
}
return children(ua.parser)
}
if (returnFullParser) {
return children(ua.parser)
}
Expand All @@ -53,13 +43,11 @@ if (process.env.NODE_ENV !== 'production') {
{}
),
returnFullParser: PropTypes.bool,
returnfullParser: PropTypes.bool,
}
}

UserAgent.defaultProps = {
returnFullParser: false,
returnfullParser: PropTypes.bool,
}

UserAgent.contextTypes = {
Expand Down
14 changes: 0 additions & 14 deletions tests/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,4 @@ describe('UserAgent', () => {
}
)
})

it('supports deprecated prop `returnfullParser`', () => {
render(
<UserAgentProvider ua={ms10UA}>
<UserAgent returnfullParser>
{parser => parser.getOS().name === 'Windows' && 'windows'}
</UserAgent>
</UserAgentProvider>,
node,
() => {
expect(node.innerHTML).toEqual('windows')
}
)
})
})