Skip to content

concurrent mode vs concurrent feature #6518

Closed
@hkjpotato

Description

@hkjpotato

in react new doc site, we only mention "concurrent feature" now https://react.dev/blog/2021/12/17/react-conf-2021-recap#react-18-and-concurrent-features
Screenshot 2023-12-25 at 10 50 47 AM

yet, in react's code, "ConcurrentMode" is still used (e.g. https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberBeginWork.js#L2524), this becomes more confusing after diving into the code and realize historically we also have "Blocking" mode facebook/react#20974 ...and more

Screenshot 2023-12-25 at 10 59 43 AM

q1: does React has some kind of "terms" wiki to explain what all these modes were/are?
q2: iiuc, after updating to React18, with ReactDOM.render it is still a legacy mode root (even Suspense cannot trigger concurrent rendering). Only createRoot will create a current root (so as to use concurrent feature).

However, I only find some fragmented info online about the difference: e.g.

  1. legacy suspense still exists in legacy root Behavioral changes to Suspense in React 18 reactwg/react-18#7 (reply in thread)
  2. automatic batching is only enabled with concurrent root https://dev.to/devmoustafa97/do-you-know-unstablebatchedupdates-in-react-enforce-batching-state-update-5cn2

Can we provide a list of difference on ReactDOM.render vs createRoot.render in react18?

this could help dev to understand / explain the changes (often behind feature flag) in org.

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