From 1a49812370255f92d40e8512cdc95e205aff8864 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 17 Jan 2019 13:25:41 +0000 Subject: [PATCH] Clarify conflicting advice --- content/docs/hooks-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/hooks-faq.md b/content/docs/hooks-faq.md index 54168284472..448501d0d24 100644 --- a/content/docs/hooks-faq.md +++ b/content/docs/hooks-faq.md @@ -156,7 +156,7 @@ If we just wanted to set an interval, we wouldn't need the ref (`id` could be lo // ... ``` -Conceptually, you can think of refs as similar to instance variables in a class. Avoid setting refs during rendering -- this can lead to surprising behavior. Instead, only modify refs in event handlers and effects. +Conceptually, you can think of refs as similar to instance variables in a class. Unless you're doing [lazy initialization](#how-to-create-expensive-objects-lazily), avoid setting refs during rendering -- this can lead to surprising behavior. Instead, typically you want to modify refs in event handlers and effects. ### Should I use one or many state variables?