aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/bug/Bug.tsx
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-06-26 11:14:31 +0200
committerMichael Muré <batolettre@gmail.com>2020-06-27 23:03:06 +0200
commit07d6c6aa32509a676f9d5b5e3abea1e382374f42 (patch)
tree515ce4e05059de07d201c8eccb907a0b18655f90 /webui/src/pages/bug/Bug.tsx
parent2ab6381a94d55fa22b80acdbb18849d6b24951f9 (diff)
downloadgit-bug-07d6c6aa32509a676f9d5b5e3abea1e382374f42.tar.gz
webui: render component's children as a function to avoid uncecessary rendering
Co-authored-by: Quentin Gliech <quentingliech@gmail.com>
Diffstat (limited to 'webui/src/pages/bug/Bug.tsx')
-rw-r--r--webui/src/pages/bug/Bug.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/webui/src/pages/bug/Bug.tsx b/webui/src/pages/bug/Bug.tsx
index 7057f5a1..34a3aa26 100644
--- a/webui/src/pages/bug/Bug.tsx
+++ b/webui/src/pages/bug/Bug.tsx
@@ -90,9 +90,11 @@ function Bug({ bug }: Props) {
<div className={classes.timeline}>
<TimelineQuery id={bug.id} />
<IfLoggedIn>
- <div className={classes.commentForm}>
- <CommentForm bugId={bug.id} />
- </div>
+ {() => (
+ <div className={classes.commentForm}>
+ <CommentForm bugId={bug.id} />
+ </div>
+ )}
</IfLoggedIn>
</div>
<div className={classes.sidebar}>