Support server components
fazpu opened this issue · comments
Hi!
I tried to use the package for the first time with "next": "13.3.1"
and "next-image-export-optimizer": "1.6.1"
with the app
routing logic and its server components.
I'm getting this:
You're importing a component that needs useState. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
,-[/Users/jiripuc/code/moje/friclegal/client/node_modules/next-image-export-optimizer/dist/ExportedImage.js:1:1]
1 | import React, { forwardRef, useMemo, useState } from "react";
: ^^^^^^^^
2 | import Image from "next/image";
3 | const splitFilePath = ({ filePath }) => {
4 | const filenameWithExtension = filePath.split("\\").pop()?.split("/").pop() || "";
`----
To the best of my knowledge, the next Image
work fine for the server components. Please, could next-image-export-optimizer
be updated so that it also works inside the server components?
Thank you for this project!