Update Writing-Addon doc

(two line change)
Update Writing-Addon doc to fix error in reading parameter data.  As currently written this causes an exception due to the object returned not being a string. Two ways to fix this, change the data passed by param to just a bare string in the story code above, or change how the addon handles the parameter data. The second is preferable since this is the more likely scenario, and a more useful showcase of passing parameter data.   This is the path I've chosen to changed.
This commit is contained in:
Herrick Spencer 2020-02-28 12:19:20 -08:00 committed by GitHub
parent 5abdfd866d
commit e85a12842e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,8 +74,8 @@ const PANEL_ID = `${ADDON_ID}/panel`;
const MyPanel = () => {
const value = useParameter(PARAM_KEY, null);
return <div>{value}</div>;
const item = value ? value.data : "";
return <div>{item}</div>;
}
addons.register(ADDON_ID, api => {