fix(react-compiler): avoid panic on non-ASCII ref-like names

Merged
CA
1mo ago
+42-1

Reading object_name[..1] panics when a ref-like identifier starts with a multibyte character, such as 한글Ref. Use .chars().next() to preserve the ASCII name check without slicing through a UTF-8 character. Ports the fix and regression fixture from https://github.com/facebook/react/pull/38025.

Fixes #28278.