reactjs - preact compat causing component to mount infinitely -


i have working reactjs app redux , react router. want switch preact. when updated webpack config alias react , react dom. component started mounting infinitely. mount unmount .. goes on doing so. webpack config.

alias: {         "react": path.resolve(__dirname, 'react.js'),         "react-dom": path.resolve(__dirname, 'react.js')         }, 

react.js

var preact = require('preact-compat'); var react = {}; object.keys(preact).foreach(function(key) {   react[key] = preact[key]; });  module.exports = react; 

this file because using react hot loader. react app working fine .. adding preact has bug. pls guide me.

from experience, preact-compat , react hot loader (rhl) don't work (it's still on todo list of developer of preact-compact, see this comment).

i work around these issues myself not combining two, i.e. use "real" react , reactdom when want use rhl, or use preact-compat when don't need rhl.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -