Skip to content

[React-Native][New Arch] Fix extra rerenders of the GLView on updating parent View pan getsture handlers and pointerEvents props #3539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NikitaDudin
Copy link

Env:
new arch enabled: +
platform: iOS - always, Android - maybe in some cases.
react: 19.0.0
react-dom: 19.0.0
react-native: 0.79.2
threejs: tested on 0.150.1, 0.176.0, 0.177.0
react-three/fiber: 9.1.2

When assigning a gesture binding, the parent component is redrawn. This causes the canvas to be redrawn and additional reinitialization of the gl context occurs, which in turn interrupts the correct execution of the gl program.
This causes errors in the following places in the threejs library file node_modules/three/build/three.cjs:

	function onFirstUse( self ) {

		// check for link errors
		if ( renderer.debug.checkShaderErrors ) {

			const programLog = gl.getProgramInfoLog( program ).trim(); // <<<<<<<<<<<<<
			// ...
	}
	function drawBuffers( renderTarget, framebuffer ) {

		let drawBuffers = defaultDrawbuffers;

		let needsUpdate = false;

		if ( renderTarget ) {

			drawBuffers = currentDrawbuffers.get( framebuffer );

			if ( drawBuffers === undefined ) {

				drawBuffers = [];
				currentDrawbuffers.set( framebuffer, drawBuffers ); // <<<<<<<<<<<<<

			}
			// ...
    }

Same issue: expo/expo#33117
Linked issue: #3333

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 457e26e:

Sandbox Source
example Configuration

@NikitaDudin NikitaDudin changed the title Fix extra rerenders of the GLView on updating parent View pan getrur… Fix extra rerenders of the GLView on updating parent View pan getsture handlers and pointerEvents props May 31, 2025
@NikitaDudin NikitaDudin changed the title Fix extra rerenders of the GLView on updating parent View pan getsture handlers and pointerEvents props [React-Native][New Arch] Fix extra rerenders of the GLView on updating parent View pan getsture handlers and pointerEvents props May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant