my blog https://overreacted.io
53
fork

Configure Feed

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

twk

+1 -1
+1 -1
public/how-imports-work-in-rsc/index.md
··· 838 838 839 839 **The directives aren't for specifying "where the code runs" module by module. You shouldn't put `'use client'` in all frontend modules or `'use server'` into all backend modules--that's pointless!** All they do is let you create "doors" between the two module systems. They let you *refer to* the other world. 840 840 841 - If you want to pass data from the backend to the frontend (as a `<script>` tag), you need to `'use client'`. If you need to pass data from the frontend to the backend (as an API call), you need to `'use server'`. Otherwise, you don't need either directive--you just use `import` as usual and stay in the current world. 841 + If you want to pass data from the backend to the frontend (as a `<script>` tag), you need to `'use client'`. If you want to pass data from the frontend to the backend (as an API call), you need to `'use server'`. Otherwise, you don't need either directive--you just use `import` as usual and stay in the current world. 842 842 843 843 --- 844 844