{"action":"opened","issue":{"url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/76","repository_url":"https://api.github.com/repos/elegantthemes/create-divi-extension","labels_url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/76/comments","events_url":"https://api.github.com/repos/elegantthemes/create-divi-extension/issues/76/events","html_url":"https://github.com/elegantthemes/create-divi-extension/issues/76","id":326287333,"number":76,"title":"componentDidMount is not called when child item is added","user":{"login":"jdurnil","id":8270103,"avatar_url":"https://avatars2.githubusercontent.com/u/8270103?v=4","gravatar_id":"","url":"https://api.github.com/users/jdurnil","html_url":"https://github.com/jdurnil","followers_url":"https://api.github.com/users/jdurnil/followers","following_url":"https://api.github.com/users/jdurnil/following{/other_user}","gists_url":"https://api.github.com/users/jdurnil/gists{/gist_id}","starred_url":"https://api.github.com/users/jdurnil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdurnil/subscriptions","organizations_url":"https://api.github.com/users/jdurnil/orgs","repos_url":"https://api.github.com/users/jdurnil/repos","events_url":"https://api.github.com/users/jdurnil/events{/privacy}","received_events_url":"https://api.github.com/users/jdurnil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-24T20:47:09Z","updated_at":"2018-05-24T20:47:09Z","closed_at":null,"author_association":"NONE","body":"### Problem Description\r\nI have the following code. I am just playing around trying to understand everything. I have child items being added successfully on the react side, but i have also have a jquery extension that needs to be run on each child item as it is placed in the visual builder. I thought componentDidMount would be the perfect place to do that. I have placed breakpoints in the function and if you create a new page and add the plugin you can add the child items and see them visually but componentDidMount is not called until the page is saved and reloaded. Intermittently you can get it to call in the right place everytime if you add my module after another standard module but it doesn't work everytime\r\n\r\n### Steps To Reproduce\r\n1. write a react script to show child items and try to use a jquery extension in componentDidMount to add some functionality.\r\n\r\n\r\n### Screenshot and/or gif\r\nimport React, { Fragment, Component } from 'react';\r\nimport jQuery from 'jquery';\r\n\r\n\r\n// Internal Dependencies\r\nimport './style.css';\r\n\r\n\r\nclass HelloWorld extends Component {\r\n\r\n\tcomponentDidMount(){\r\n\t\tconsole.log('hello');\r\n\t\tjQuery(\".main\").tiltedpage_scroll({\r\n\t\t\tsectionContainer: \"> section\",    \r\n\t\t\tangle: 50,                        \r\n\t\t\topacity: true,                    \r\n\t\t\tscale: true,                      \r\n\t\t\toutAnimation: true                \r\n\t\t});\r\n\t}\r\n\r\n\tstatic slug = 'etl_hello_world';\r\n\trenderImages(){\r\n\t\tconst children = this.props.content;\r\n\t\tconsole.log(children);\r\n\t\tif(this.props.content) {\r\n\t\t\treturn this.props.content.map((content) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<section key={content.key}>\r\n\t\t\t\t\t\t<img src={content.props.attrs.src} alt=''/>\r\n\t\t\t\t\t</section>\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t} else{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}\r\n\trender() {\r\n\r\n\t\t\r\n\r\n\t\treturn (\r\n\r\n\t\t\t\t<div className=\"main\">\r\n\t\t\t\t{this.renderImages()}\r\n\t\t\t\t</div>\r\n\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default HelloWorld;\r\n"}}
{"actor":{"display_login":"jdurnil"}}