There's a function getValue in frontend/components/PhotoViewer.js that takes a dict, looks for a key, and returns a supplied default value if the key is missing.
Looks like the author was trying to get default values for a config dict going -- we can replace a dict of default args, or use the || operator to provide the same basic functionality.
e.g., instead of
const className = getValue(config, "className", "");
do this:
const className = config.className || "";
There's a function
getValue
infrontend/components/PhotoViewer.js
that takes a dict, looks for a key, and returns a supplied default value if the key is missing.Looks like the author was trying to get default values for a config dict going -- we can replace a dict of default args, or use the
||
operator to provide the same basic functionality.e.g., instead of
const className = getValue(config, "className", "");
do this:
const className = config.className || "";