use-context-selector icon indicating copy to clipboard operation
use-context-selector copied to clipboard

user-context-selector is not supported React Native 0.68 ?

Open dev01-linvix opened this issue 3 years ago • 5 comments

user-context-selector is not supported React Native 0.68 ?

dev01-linvix avatar Jun 09 '22 19:06 dev01-linvix

Looking at #82, it seems like people are using it with RN 0.68, maybe?

dai-shi avatar Jun 09 '22 23:06 dai-shi

yep, using it with RN 0.68 in our app, it works perfectly fine!

lightrow avatar Jul 06 '22 13:07 lightrow

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'

Rodrigojorge avatar Jul 08 '22 13:07 Rodrigojorge

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.

dai-shi avatar Jul 08 '22 14:07 dai-shi

I mocked it and it was enough to handle for me. Thanks

const ReactDom = {
  render: jest.fn(),
}

export default ReactDom;

Rodrigojorge avatar Jul 08 '22 19:07 Rodrigojorge