Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 629036a9c4fa925351fe714162dd2218eef3ac56
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6cd842854d6b1be8be802f68d4da60147e8a39da
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Feb 25, 2022

  1. useId: Use 'H' to separate main id from hook index

    No id should be a subset of any other id. Currently, this is not true
    when there are multiple hooks in the same component. We append the
    hook index to the end of the id, except for the first one. So you get
    this pattern.
    
    Before this change:
    
    - 1st hook's id: :R0:
    - 2nd hook's id: :R0:1:
    
    The first hook's id is a subset of all the other ids in the
    same component.
    
    The fix for this is to use a different character to separate the main
    id from the hook index. I've chosen a captial 'H' for this because
    capital letters are not part of the base 32 character set when encoding
    with `toString(32)`.
    
    After this change:
    
    - 1st hook's id: :R0:
    - 2nd hook's id: :R0H1:
    acdlite committed Feb 25, 2022
    Configuration menu
    Copy the full SHA
    6cd8428 View commit details
    Browse the repository at this point in the history
Loading