-
-
Notifications
You must be signed in to change notification settings - Fork 148
Cannot define property:children, object is not extensible. #105
Comments
Hi @slmgc - was this with preact |
@developit I've tried it with:
Some of my components use higher-order wrappers that's why it's not easy to reproduce. |
@slmgc The error is happening because <Posts {...this.props.posts } />
// Babel optimization transforms the above to no-copy:
h(Posts, this.props.posts); I was able to work around the issue by changing the code to this: // clone the object first:
<Posts {...{ ...this.props.posts }} />
// add any property to have babel do the clone for you:
<Posts foo {...this.props.posts} />
// clone explicitly:
let posts = Object.assign({}, this.props.posts);
<Posts {...posts} /> I think we can at least catch this in |
Seems to be working nicely now with |
@developit works smoothly, thanks a lot! |
Hi!
I've tried to add preact-compat to my app and it failed with this error.
It happens when I use this construct:
I was able to resolve it by replacing with:
P.S. I wasn't able to reproduce this issue with some minimal code snippet
but it happens in my boilerplate app:
https://github.com/slmgc/preact-baobab-template/blob/dev/src/controllers/posts.js#L15
The text was updated successfully, but these errors were encountered: