KITFORMA · EDITORIAL ANSWER
Why does optional callback invocation throw for JSON configuration?
KitForma editorial guide. config.onSave?.() only skips nullish values; a present string is not callable.
Step-by-step answer
config.onSave?.() only skips nullish values; a present string is not callable. If the property can come from data, require typeof config.onSave === "function" or separate callback configuration from JSON data entirely. Test missing, null and string values. Optional chaining does not validate a schema or repair an undeclared root variable.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This editorial answer was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.