Attribute-hooks
See original GitHub issueSupport for style
diffing (setting style
to an object
value) was removed, and there is currently no way for a library to add it back in.
As discussed here this could be solved by reconsidering support for modularity, which was previously proposed in #86. (this PR is outdated, and the approach is probably wrong, see below.)
Note that the approach in that PR was based on use a global registry, which should be avoided, as discussed in the comments above.
Needs a detailed proposal, but one idea is to make this feature available via currying to avoid global state. You would get a default instance of the render
function with only the built-in attribute-handlers - as well as a factory-function, which you could use to generate another instance of render
with additional attribute-handlers registered in the instance of it, to avoid global state and side-effects.
For example:
import * as ultradom from "ultradom";
export const render = ultradom.render.with({
style: (el, value, oldNode, newNode) => {
// diff and apply style properties
}
});
That’s just an idea - this needs a more detailed proposal.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (9 by maintainers)
And now it’s gone again. 😏
Style support is back.