Skip to content

Use React 17 with Docusaurus v2 #3617

Closed

Description

@HonkingGoose

💥 Proposal

Use React 17 with Docusaurus v2.

Have you read the Contributing Guidelines on issues?

Yes.

Relevant quotes from the React 17 official blog post:

No New Features

The React 17 release is unusual because it doesn’t add any new developer-facing features. Instead, this release is primarily focused on making it easier to upgrade React itself.

In particular, React 17 is a “stepping stone” release that makes it safer to embed a tree managed by one version of React inside a tree managed by a different version of React.

It also makes it easier to embed React into apps built with other technologies.


Gradual Upgrades

React 17 enables gradual React upgrades. When you upgrade from React 15 to 16 (or, this time, from React 16 to 17), you would usually upgrade your whole app at once. This works well for many apps. But it can get increasingly challenging if the codebase was written more than a few years ago and isn’t actively maintained. And while it’s possible to use two versions of React on the page, until React 17 this has been fragile and caused problems with events.

References:

Official React blog post about version 17

I'm already using React 17 with a simple site

I'm already using React 17 with Docusuarus v2 for a very simple documentation site, and that seems to work fine for my limited use-case. The build passes, and the site is not obviously broken.

The main thing that I'm noticing now, is that Yarn shouts at me when I run yarn install because I'm using React 17 instead of 16 like Docusaurus v2 wants me to: warning " > @docusaurus/[email protected]" has incorrect peer dependency "react@^16.8.4". and so on for all Docusaurus v2 packages.

Activity

  1. added
    status: needs triage
    proposal
    on Oct 21, 2020
  2. slorber commented on Oct 21, 2020

    @slorber
    Collaborator

    As I don't see any new React 17 feature that we would benefit much from, I'd rather not be an early adopter and wait a bit to make this upgrade safer. We'll do it, but it does not need to be right now.

  3. linked a pull request that will close this issuefeat(v2): support/use React v17 by default #4218on Feb 12, 2021
  4. removed
    status: needs triage
    on Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions