English 中文(简体)
如何获得与未来JS服务器-侧部件合作的磷酸液?
原标题:How to get phosphor-react icons working with NextJS server-side components?

其次,js现在建议我们使用App Dir,但由于现在所有的服务器都是由于违约而提供的,我们将把所有需要互动的内容放在“用户”旗帜下。

问题在于,Phosphor React Icons在服务器上投下错误,我不知道如何操作,因为在某些部分使用,而某些部件在客户方面是没有意义的,如果我只为每个icon Im制造部件,而只用于在“用户”中包装每个icon?

在服务器后部件或一页使用磷酸ons时,我发现这一错误:

Maybe one of these should be marked as a client entry with "use client":
  ./node_modules@phosphor-icons
eactdistlibcontext.es.js
  ./node_modules@phosphor-icons
eactdistindex.es.js
  ./srcapppage.tsx

将每个图标包装在客户端组件中是正确的解决方案吗?

问题回答

不知道这是否是最好的解决方案,但我目前正在使用它:

我在北极圈/塞特/基恩/克塔建立了一把手。

在这种夹子中,我为我想要使用和出口这些单子制作一个档案:

// assets/icons/MagnifyingGlass.tsx

 use client 

import { MagnifyingGlass } from  @phosphor-icons/react 

export default MagnifyingGlass

无论如何,我想利用这些资产从这些资产进口。





相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签