my blog https://overreacted.io
53
fork

Configure Feed

Select the types of activity you want to include in your feed.

typo

+3 -1
+3 -1
public/how-imports-work-in-rsc/index.md
··· 830 830 831 831 That's the "remaining 10%" that RSC adds. 832 832 833 - In RSC, imports on both sides normally *work like regular imports*--but `'use client'` changes this behavior to "opening a door" to the frontend environment. When you add `'use client'`, you're saying: "If you import me from the backend world, don't actually bring my code *into* the backend--instead, provide a reference that React can turn eventually into a `<script>` tag and revive on the frontend. 833 + In RSC, imports on both sides normally *work like regular imports*--but `'use client'` changes this behavior to "opening a door" to the frontend environment. 834 + 835 + When you add `'use client'`, you're saying: "If you import me from the backend world, don't actually bring my code *into* the backend--instead, provide a reference that React can turn eventually into a `<script>` tag and revive on the frontend." 834 836 835 837 Likewise, [`'use server'`](/what-does-use-client-do/#use-server) lets a piece of the frontend code "open the door" to the backend and *refer* to a backend module *without* bringing it *into* the frontend world. 836 838