GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Upgrade to react-native 0.86, generic events/elements, typed refs by Freddy03h · Pull Request #858 · rescript-react-native/rescript-react-native

Conversation

@Freddy03h

@Freddy03h Freddy03h commented Nov 11, 2026

Copy link
Copy Markdown
Member

Upgrade the bindings to [email protected], plus a pass on events, elements and refs. Bindings were checked against the generated types of [email protected]. One commit per topic, each commit builds on its own.

React Native 0.86

  • Breaking: BackHandler.addEventListener handler receives a hardwareBackPressEvent (type_, timeStamp) instead of unit
  • Style.blendMode: add #"plus-lighter"
  • Pressable.rippleConfig: add alpha; TouchableNativeFeedback.Background.ripple takes a Color.t (accepts PlatformColor)
  • TextInput.autoComplete: new Android autofill hints, plus values that were already missing (current-password, new-password, given-name, …)
  • peerDependencies: react-native >= 0.86.0
  • No new deprecation affects the bindings (ViewUtil.getUIManagerType is native Android, setComponentProviderInstrumentationHook isn't bound)

Fixes

  • Breaking: synthetic events target and currentTarget are native elements (DOMAPI.anyElement), not numbers. The renderer sets them to the element's public instance since the new architecture (the only one since RN 0.82), and the web-based event dispatching of RN 0.88 keeps them as elements.
  • Breaking: getBoundingClientRect returns a Layout.domRect (x, y, width, height, top, right, bottom, left), it was typed as Rect.t
  • Add Rect.size to pass a number to hitSlop / pressRetentionOffset

Events

  • Generic Event.syntheticEvent<'payload> / Event.responderSyntheticEvent<'payload> records with Event.Methods / Event.ResponderMethods
  • Event.SyntheticEvent / Event.ResponderSyntheticEvent functors stay the public API to define an event module, now built on these records: events of third-party bindings share the same type and get new methods for free
  • Breaking: bubbles, cancelable, defaultPrevented, eventPhase, isTrusted and type are option<…> (undefined while the handler runs, never null; event pooling errors stay explicit, see Event.layoutEvent needs to be Js.Nullable.t #832)
  • Breaking: the nativeEvent getter returns the payload type instead of 'a

Elements and refs

  • Element methods are generic externals on DOMAPI.element<'nativeElement>. Component-specific methods are restricted by the element kind ([> #scrollView], [> #textInput], …): FlatList gets the ScrollView methods, TextInput doesn't. No more *Methods.Make functor applied at runtime.
  • NativeElement.Impl stays the public API to define an element module, now based on NativeElement.Methods
  • DOMAPI.Node.Impl takes a type constructor so node methods are written once; DOMAPI.Element accepts any element
  • Typed useRef in every element module: let ref = TextInput.useRef(), compiled to React.useRef(null)
  • Ref.t is the object ref type: pass it directly (ref=myRef), and the generated JS no longer wraps it in Primitive_option.some. Add Ref.callbackWithCleanup (React 19). Ref.value / Ref.valueRef are deprecated.
  • Breaking: remove the internal NativeMethods.Make / *Methods.Make functors, DOMAPI.Element.Impl, and the deprecated NativeElement.element / NativeElement.ref types

Notes for reviewers

  • npm test passes (clean build, warnings as errors). Changes were checked by compiling throwaway usage files and reading the generated JS; nothing was run in a real React Native app.
  • Third-party bindings of the org (safe-area-context, flash-list, rescript-react-navigation) were compiled against this branch and still build (react-navigation has its own unrelated Js.* deprecation warnings with ReScript 12).
  • Public functors (NativeElement.Impl, Event.SyntheticEvent) are kept on purpose as a stable API for third-party bindings, even though applying them costs one empty function call per module at load.
  • The website still uses Ref.value in scrollview.md, to update separately.
  • package.json version is still 0.85.0, to be bumped in the release commit.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Freddy03h and others added 7 commits November 11, 2026 10:05
@Freddy03h @claude
upgrade to react-native 0.86
19dcc3c
- BackHandler: handler receives a hardwareBackPressEvent (breaking)
- Style.blendMode: add plus-lighter
- Pressable.rippleConfig: add alpha
- TouchableNativeFeedback.Background.ripple takes a Color.t (PlatformColor)
- TextInput.autoComplete: add new Android autofill hints and missing values
- peerDependencies: react-native >= 0.86.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h @claude
fix: type synthetic event target and currentTarget as native elements
013eaaf
With the new architecture (the only one since RN 0.82), the renderer sets
target and currentTarget to the public instance of the native element,
not to a numeric view tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h @claude
refactor: generic event records behind Event.SyntheticEvent
dcd9b24
- generic Event.syntheticEvent<'payload> and responderSyntheticEvent<'payload>
  records, with Event.Methods / Event.ResponderMethods externals
- Event.SyntheticEvent / ResponderSyntheticEvent functors stay the public API to
  define an event module, now based on these records: events of third-party
  bindings share the same type and get new methods for free
- bubbles, cancelable, defaultPrevented, eventPhase, isTrusted and type are
  option<...> (undefined while the handler runs, never null)
- nativeEvent getter returns the payload type instead of 'a

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h @claude
refactor: generic element methods behind NativeElement.Impl
ea53871
- NativeMethods, DOMAPI.Element and *Methods modules are generic externals on
  DOMAPI.element<'nativeElement>, no more *Methods.Make functor applied at
  runtime
- DOMAPI.Node.Impl takes a type constructor so node methods are written once
  and stay generic for elements; DOMAPI.Element.Impl is removed
- component-specific methods are restricted by a polymorphic variant kind
  ([> #scrollView], [> #textInput], ...), so lists keep ScrollView methods
  and TextInput doesn't get them
- NativeElement.Impl stays the public API to define an element module, now
  based on NativeElement.Methods: third-party bindings get new methods for free
- remove the internal *Methods.Make functors and the deprecated
  NativeElement.element / NativeElement.ref types

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h @claude
fix: getBoundingClientRect returns a DOMRect, add Rect.size
5fa6796
- DOMAPI.Element.getBoundingClientRect returns a Layout.domRect (x, y, width,
  height, top, right, bottom, left), it was wrongly typed as Rect.t (insets
  with optional fields)
- add Rect.size to pass a single number to hitSlop / pressRetentionOffset,
  as React Native accepts a number for these props

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h @claude
add a typed useRef to every element module
c51d0e3
NativeElement.Impl provides useRef, an external to React.useRef(null) typed
for the element: `let ref = TextInput.useRef()` instead of annotating the
ref or each use of its current value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h @claude
Ref.t is the object ref type, add Ref.callbackWithCleanup
ad84331
- Ref.t is React.ref<nullable<'element>>: an object ref is passed directly
  (ref=myRef), and the generated JS no longer wraps it in Primitive_option.some
- add Ref.callbackWithCleanup for React 19 callback refs returning a cleanup
- deprecate Ref.value and Ref.valueRef, no longer needed
- typed useRef of element modules returns the element ref type

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T11:35:33.253308Z ad84331 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Freddy03h @claude
update package-lock.json for the react-native >= 0.86 peer dependency
15800df
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Freddy03h
Freddy03h requested review from cknitt and fhammerschmidt November 11, 2026 12:15
fhammerschmidt
fhammerschmidt approved these changes Nov 11, 2026
View reviewed changes
@Freddy03h
Freddy03h merged commit 1bef020 into main Nov 12, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Freddy03h
Freddy03h deleted the react-native-86 branch November 12, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@fhammerschmidt fhammerschmidt fhammerschmidt approved these changes
@cknitt cknitt Awaiting requested review from cknitt

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Freddy03h @fhammerschmidt
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.