Permalink
Browse files

Use Array.from(elements).forEach (#4)

* Use Array.from(elements).forEach

* Use Array.prototype.forEach.call instead
  • Loading branch information...
scmx authored and geolessel committed May 29, 2017
1 parent cb244b4 commit 7a1dbea7ef5630fc06865a038187b69b886d0fa0
Showing with 2 additions and 2 deletions.
  1. +1 −1 priv/js/react_phoenix.js
  2. +1 −1 src/react_phoenix.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -4,7 +4,7 @@ import ReactDOM from "react-dom"
export default class ReactPhoenix {
static init() {
const elements = document.querySelectorAll('[data-react-class]')
elements.forEach(e => {
Array.prototype.forEach.call(elements, e => {
const targetId = document.getElementById(e.dataset.reactTargetId)
const targetDiv = targetId ? targetId : e
const reactProps = e.dataset.reactProps ? e.dataset.reactProps : "{}"

0 comments on commit 7a1dbea

Please sign in to comment.