Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

React StrictMode yields warnings #2509

Closed
WesleyKapow opened this issue Oct 16, 2018 · 8 comments
Closed

React StrictMode yields warnings #2509

WesleyKapow opened this issue Oct 16, 2018 · 8 comments

Comments

@WesleyKapow
Copy link

componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Mutation

React Blog post about this: https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

Looks like this is only used in a few spots in the codebase (excluding test code):

Version

  • apollo-client@2.3.5
  • react-apollo@2.24
@JoviDeCroock
Copy link
Contributor

Normally the upgrade to componentDidUpdate is rather small but the implications should be checked, I can check it out later this week if no one else wants to :)

@mike-marcacci
Copy link
Contributor

This appears to already be addressed in the 3.0 alpha, and I'm definitely interested in breaking out these changes. I don't really see adoption of "async mode" on the roadmap, maybe somebody from the core team can comment?

@JoviDeCroock
Copy link
Contributor

That PR/Branch seems pretty stale

@onpaws
Copy link

onpaws commented Nov 1, 2018

I enjoyed doing a bit of experimenting with async Apollo back when 3.0.0-alpha.0 first appeared in March (and later, 3.0.0-alpha.2).

As the React team has regularly mentioned through the year, the public async API isn't finished. I recently noticed things indeed changed a bit as of 16.7.0-alpha -- if I'm not mistaken, ReactDOM.unstable_deferredUpdates should now be accomplished via ReactDOM.createRoot().

I'm no expert but amidst these changes, the overall concepts seem to be stable (right?), community interest in this seems to remain high, and with the initial version of Suspense shipping recently, I'm curious where concurrency falls on the apollo-react roadmap.

@onpaws
Copy link

onpaws commented Nov 1, 2018

This is what happened when I tried to use <ApolloProvider> in a new CRA-generated app, using ReactDOM.createRoot() in my index.js:
image

So yeah, a StrictMode warning. I am hardly qualified to comment -- based on that warning it looks like there will be at least some work needed to adopt the new Context API? (I imagine that's already started somewhere on this repo...) When I try to npm i react-apollo@canary I'm getting some errors**

Would be nice if someone from the Apollo team in a position to know could chime in. Would be happy to contribute to the effort, just need some help identifying what it will take to get us to 3.0.0-alpha.3.

@jbaxleyiii @peggyrayzis

* specific versions:
react-apollo v2.3.4
react & react-dom v16.7.0-alpha
react-script 2.1.1

** here's what happens when I try the canary as of Nov 1 2018

yarn add react-apollo@canary
yarn add v1.12.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
error /Users/paws/projects/odin-ts/node_modules/react-apollo: Command failed.
Exit code: 127
Command: rimraf ./node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js && cp ./scripts/ReactSixteenAdapter.js ./node_modules/enzyme-adapter-react-16/build/
Arguments: 
Directory: /Users/paws/projects/odin-ts/node_modules/react-apollo
Output:
/bin/sh: rimraf: command not found
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@rosskevin
Copy link
Contributor

Please feel free to enable strict mode and submit PRs to update components. Every little bit helps.

@Viperwow
Copy link

Viperwow commented Jun 4, 2019

Is there any plans to fix this issue in the nearest future? Or maybe you have some more info about a cause of the given problem?

@hwillson
Copy link
Member

The RA 3 release (coming soon) will address all warnings. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants