From 3edd5f7cc1c822047a2711ffbb7f4433f53eba5b Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Wed, 20 Sep 2023 18:22:26 +0600 Subject: [PATCH] wip: add directive questions --- src/data/question-groups/react/react.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/data/question-groups/react/react.md b/src/data/question-groups/react/react.md index c94706ca1..2cbe6df38 100644 --- a/src/data/question-groups/react/react.md +++ b/src/data/question-groups/react/react.md @@ -312,4 +312,14 @@ questions: topics: - 'Core' - 'Beginner' + - question: What are `use client` and `use server` Directives in React 18? + answer: In React 18, `use client` and `use server` are directives. The `use client` directive marks source files whose components are intended to execute only on the client. Conversely, `use server` marks server-side functions that can be invoked from client-side code. + topics: + - 'Core' + - 'Intermediate' + - question: Can you use hooks in Server Components? + answer: No, hooks are not supported in Server Components. Hooks are a client-side feature and are not supported in Server Components. However, you can use hooks in client components and import them into Server Components. + topics: + - 'Core' + - 'Intermediate' ---