Skip to content

[RFC] React 18 and types-only breaking changes #46691

@eps1lon

Description

@eps1lon

Edit: We're likely not doing that in 17 but 18 to make the 17 upgrade as easy as possible. See #46691 (comment) for more context.

Among active contributors we talked informally about making some breaking changes to @types/react in an upcoming major release of React that we think will improve the typings long-term. Now that a release candidate for React 17 is available we should formalize what breaking changes we want to make.

GitHub issues is not the best place for discussing umbrella topics (no threading) but hopefully this will do.

breaking changes

@gaearon Should we hold off with removing deprecated React features? We currently flag the following features as deprecated:

  • deprecated lifecycles (cWM, cWRP, cWU, UNSAFE_ prefixed lifecycles)
    Maybe removing the unprefixed ones is a viable migration path?
  • class component constructors with context as the second argument
  • class components this.refs i.e. string refs

features

Already part of next.d.ts

How to go about it?

See #46690 where we can test the approaches. Ideally @types would understand pre-releases but I couldn't find documentation about it so we have to be practical about the approach chosen.

@types/react authors

@johnnyreilly, @bbenezech, @pzavolinsky, @digiguru, @ericanderson, @DovydasNavickas, @theruther4d, @guilhermehubner, @ferdaber, @jrakotoharisoa, @pascaloliv, @Hotell, @franklixuefei, @Jessidhia, @saranshkataria, @lukyth, @eps1lon, @zieka, @dancerphil, @dimitropoulos, @disjukr, @vhfmag, @hellatan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions