Skip to content

Commit

Permalink
fix: prevent "morphdom is not a function" error
Browse files Browse the repository at this point in the history
The actual morphdom function isn't available because of modules/bundlers. See max-mapper#75 (comment) for more information.

Closes max-mapper#75
  • Loading branch information
davidguttman authored Dec 26, 2020
1 parent 92e7b08 commit dfee290
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ var bel = require('bel') // turns template tag into DOM elements
var morphdom = require('morphdom') // efficiently diffs + morphs two DOM elements
var defaultEvents = require('./update-events.js') // default events to be copied when dom elements update

if (morphdom.default) morphdom = morphdom.default // hack for https://github.com/maxogden/yo-yo/issues/75#issuecomment-579984499

module.exports = bel

// TODO move this + defaultEvents to a new module once we receive more feedback
Expand Down

0 comments on commit dfee290

Please sign in to comment.