Skip to content

Commit

Permalink
fix: getting vdom prop when vdom is not ready yet
Browse files Browse the repository at this point in the history
  • Loading branch information
finalclass committed Dec 29, 2021
1 parent 5790765 commit 0789352
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function register(Component, tagName, propNames, options) {
propNames.forEach((name) => {
Object.defineProperty(PreactElement.prototype, name, {
get() {
return this._vdom.props[name];
return this._vdom?.props?.[name];
},
set(v) {
if (this._vdom) {
Expand Down

0 comments on commit 0789352

Please sign in to comment.