use-context-selector
use-context-selector copied to clipboard
user-context-selector is not supported React Native 0.68 ?
user-context-selector is not supported React Native 0.68 ?
Looking at #82, it seems like people are using it with RN 0.68, maybe?
yep, using it with RN 0.68 in our app, it works perfectly fine!
It worked for me on RN, thank you by the way.
But I'm trying to run some tests with Jest on RN now and I received an error requiring react-dom. I can try to manage that but I wonder if it should be required by this lib...
Cannot find module 'react-dom' from 'node_modules/use-context-selector/dist/index.umd.js'
I'm hoping React Native to pick index.native.modern.js, not index.umd.js which is for react-dom.
https://github.com/dai-shi/use-context-selector/blob/d8aa3cc21a0df13e5efc51cde704e85696c687a1/package.json#L13
Maybe you need to configure Jest somehow to pick RN bundle.
I mocked it and it was enough to handle for me. Thanks
const ReactDom = {
render: jest.fn(),
}
export default ReactDom;