Shared UI library built with tsup.
- The interactive components have
use client.
In my ui/dist/index.js, I get the error:
The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
You can see the use client at the top of ui/dist/index.js
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }"use client"
Since everything bundled together, is it bad that I have use client in my ui library?
Cause at this point no matter which component I use from the shared UI library, I need to wrap it in use client in the consuming app even if there is nothing interactive.