Skip to content

@preact/signals-react-transform@0.8.1

Choose a tag to compare

@github-actions github-actions released this 04 Feb 08:11
28b5900

Patch Changes

  • #814 a5d0a6e Thanks @andrewiggins! - Fix JSX detection leaking to non-component functions in the same scope

    Previously, when a component containing JSX was defined inside another function, the JSX detection could incorrectly "leak" to sibling functions or the parent function, causing non-components to be transformed. This was especially problematic in test files where components are defined inside it() or describe() blocks.

    describe("suite", () => {
    	it("test", () => {
    		// This arrow function was incorrectly transformed because
    		// Counter's JSX detection leaked to sibling functions
    		const CountModel = () => signal.value;
    		function Counter() {
    			return <div>Hello</div>;
    		}
    	});
    });

    The transform now correctly scopes JSX and signal usage detection to only the containing component or custom hook function.

  • Updated dependencies [5794b04]:

    • @preact/signals-react@3.8.0