From dd35cf591f821f7da8efef9f8e4ebaba37895488 Mon Sep 17 00:00:00 2001 From: Roland Date: Sat, 11 Jan 2025 11:06:31 -0700 Subject: [PATCH] May not be able to use child trick to prevent excess navbar space usage, log a debug warning. --- app/src/components/Nav.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/components/Nav.js b/app/src/components/Nav.js index 17d8ef9b..5fc50ad8 100644 --- a/app/src/components/Nav.js +++ b/app/src/components/Nav.js @@ -61,7 +61,12 @@ function MenuLink({link}) { function NavIconWrapper({children}) { // Do not add margins around empty react element to avoid filling up navbar. - const emptyChild = !children || isReactChildNull(children); + let emptyChild = false; + try { + emptyChild = !children || isReactChildNull(children); + } catch (e) { + console.debug('Failed to get children of react element'); + } const style = emptyChild ? {} : {marginTop: '0.8em', marginLeft: '1.5em'}; return
{children}
}