mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 22:14:05 +00:00
fix(react-widget): drop the stranded 'use client' directive
Parcel's library build concatenates modules, so the directive at the top
of DocsGPTWidget.tsx landed a thousand lines into dist/module.js and
dist/main.js. webpack rejects a 'use client' that is not the first
expression in the file, which broke every Next.js consumer of
docsgpt-react:
x The "use client" directive must be placed before other expressions.
1168 | 'use client';
The directive could not do its job from inside a bundle anyway. A React
Server Components boundary has to be declared by the importing module,
so consumers wrap the widget in their own client component instead.
This commit is contained in:
1 parent
d76a8d417e
commit
74b4ae30f9
1 file changed
-1
@@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import React, { useRef } from 'react';
|
||||
import DOMPurify from 'dompurify';
|
||||
import styled, { keyframes, css } from 'styled-components';
|
||||
|
||||
Reference in new issue
Block a user