$ npm i -S penguin-inplace
Then edit your package.json
file to include the component.
{
"penguin": {
"components": {
"Inplace": "penguin-inplace"
}
}
}
<div data-component='Inplace' data-props='{"field":"simple-span-label"}'>
<strong>My default content</strong>
</div>
This component uses contenteditable to make the target element editable and decodes all HTML by using innerText
to set the content. The static part simply renders the innerHTML
of the element.
field
- Specifies the field to modify in the state