roginfarrer / eslint-plugin-react-server-components

ESLint rule for enforcing "use client" in React client components
MIT License
30 stars 4 forks source link

Allow useMemo hook in server components #13

Open Dwlad90 opened 3 months ago

Dwlad90 commented 3 months ago

The useMemo hook is allowed for use in RSC, although this is not written in the official documentation. An example of using this hook in RSC can be found here.

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: fcc1430511b7e59f0c22170c26f0700458d71aec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------------------- | ----- | | eslint-plugin-react-server-components | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

roginfarrer commented 3 months ago

Interesting, this is new to me. I did a little bit of research and there's not much discussion about this topic. That gives me some pause about changing this plugin.

Here's a recent discussion about it in the next.js repo. It makes it sound like it might not work the same on the server as it does on the client (or perhaps there's better solutions on the server). https://github.com/vercel/next.js/discussions/68071#discussioncomment-10134807