CSS :target selector behavior changes with React 18's createRoot
The issue reports that CSS :target selector behavior breaks when using React 18's createRoot API, particularly in Chrome and Safari. The problem appears to involve rendering differences between React versions, but the exact root cause isn't clearly identified. Browser-specific behavior adds complexity to diagnosis.
go to react id target linkreact id target with green backgroundLink to code example:
The webpage source code is simple. You could check the source code directly.
Or, you can check this: https://gist.github.com/magic-akari/475a13219394fb938cff4169a9b61eb7
CSS target selector does not work. The green background disappears after refresh pages.
CSS target selector should work after refresh pages.
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!