-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Unknown prop warning on allowed props #7601
Comments
Can you share your component/test case that's getting these warnings? Or better yet, a repo reproducing this |
I am also getting this. I'll try to get a test repo later today. Also getting:
|
Same issue here. Jest output:
Simplified repro...
export default class App extends Component {
render() {
return (<div className="foo">bar</div>)
}
}
import React from 'react'
import {Provider} from 'react-redux'
import renderer from 'react-test-renderer'
import {applyMiddleware, createStore} from 'redux'
import thunk from 'redux-thunk'
import App from '../components/App'
import rootReducer from '../reducers'
jest.mock('react/lib/ReactDefaultInjection')
const store = createStore(rootReducer, {}, applyMiddleware(thunk))
describe('foo', () => {
it('bar', () => {
const component = renderer.create(
<Provider store={store}>
<App />
</Provider>
)
expect(component.toJSON()).toMatchSnapshot()
})
}) |
Thanks @tonygentilcore, I'll try and reproduce. Why are you mocking |
That seems suspicious, doesn't it. It was suggested in some SO post or GH issue as a workaround for the following. If I remove it, the test spits:
|
@tonygentilcore check out #7386, that's expected behavior at the moment. You can't use react-test-renderer with another library that uses react-dom, as they both try to call Are you able to reproduce the unknown prop warning at all without mocking
I have a feeling that is likely what's causing this issue. If you know where you saw that recommendation I'd be super interested in knowing. |
Yes. I too use the workaround. I came to know about it through the recommendtations in this issue jestjs/jest#1353 I guess we have to tolerate this warning till 15.4.0 |
Yes. I was. On Sep 4, 2016 7:25 PM, "bsr203" [email protected] wrote:
|
Thanks guys, I'm going to close this out for now since 15.4 will resolve the root cause and this workaround isnt really recommended. |
@aweary I see a new rc at npm
I do not see a |
The issue with |
In some of my jest (snapshot) test, I see this warning.
but, className is how react set the class attribute. I do understand the change brought by react 15.0.2, but not sure why getting this for className.
I get same warning for more attributes
I use jest
14.1.0
and react15.3.1
.The text was updated successfully, but these errors were encountered: