Open samueljseay opened 5 years ago
Any updates?
If you were struggling with this, as a temporary workaround / hack for Preact X, you can do the following:
import picostyle from 'picostyle';
import { h } from 'preact';
const _styled = picostyle(h);
export const styled = (nodeName) => {
return (decls) => {
return (attributes, _context, children) =>
_styled(nodeName)(decls)(attributes, children);
};
};
I'm working on this, but running into typescript type definition errors. I'm new to typescript, so it's taking a little while to figure out.
Thanks a lot, @pbondoer. This issue should be pinned.
Cross posting this from an issue I raised here: https://github.com/preactjs/enzyme-adapter-preact-pure/issues/61
Picostyle expects the render function to be called with the second argument being the children of the component, not the context, this should be an element, string or array. An invalid VNode is created because of this.
full comment describing the issue here: https://github.com/preactjs/enzyme-adapter-preact-pure/issues/61#issuecomment-508912849