Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

/**
* This file was automatically generated by the Stencil React Output Target.
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ describe('createStencilReactComponents', () => {
clientModule: './client',
});

expect(result).toContain(`'use client';`);
expect(result).not.toContain(`'use client';`);
expect(result).toContain(`// @ts-ignore - ignore potential type issues as the project is importing itself`);
expect(result).toContain(`import * as clientComponents from "./client";`);
expect(result).toContain(`from '@stencil/react-output-target/ssr'`);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/create-stencil-react-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const createStencilReactComponents = ({
* automatically attach the `use client` directive if we are not generating
* server side rendering components.
*/
const useClientDirective = `'use client';\n\n`;
const useClientDirective = hydrateModule ? '' : `'use client';\n\n`;
const autogeneratedComment = `/**
* This file was automatically generated by the Stencil React Output Target.
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Loading