Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

Invoking `useObservables` causes React to warn me about not using UNSAFE_componentWillReceiveProps in strict mode. #1442

Open dsemelianov opened 1 year ago

dsemelianov commented 1 year ago

I'm integrating WatermelonDB into my React project. Everything is fine until I add my first invocation of useObservables, like so:

const enhance = withObservables([], () => ({ senders: db.collections.get("senders").query().observe(), }));

export const EnhancedUnsubscribeTab = enhance(UnsubscribeTab);

Whenever I run the project and get to the point where the EnhancedUnsubscribeTab component is rendered, React throws this error in the console:

Screen Shot 2022-11-27 at 1 07 09 AM

Is this normal?

radex commented 1 year ago

Yes it is. @dsemelianov Can you add to docs-website information that it is normal?