Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting RSC in react-icons package #606

Open
gadingnst opened this issue Jul 12, 2023 · 2 comments
Open

Supporting RSC in react-icons package #606

gadingnst opened this issue Jul 12, 2023 · 2 comments
Assignees

Comments

@gadingnst
Copy link

gadingnst commented Jul 12, 2023

we have used these icons in our Design System.

but. when we use NextJS 13 with App Router, we can't import the icon directly in RSC like:

import { DismissSquareRegular } from `@fluentui/react-icons`;

function ListingWalletHeader() {
  return (
    <div className="flex items-center">
      ...
      <DismissSquareRegular />
    </div>
  );
}

it will return an error like this:
Screenshot 2023-07-13 at 06 03 57

can we develop the icons to support RSC feature? maybe we just create the icon SVG without createContext?
maybe just like this

@chevsky
Copy link
Contributor

chevsky commented Jul 27, 2024

Hi @gadingnst,
It's been a while, but now it's possible to use icons directly in server components without re-exporting. Version 2.0.250 now includes "use client" underneath, so it can be removed from user-space codebases. Keep in mind that icons will still be included in the client bundle.

@gadingnst
Copy link
Author

Cool, thanks. Will try it @chevsky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants