mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
webcomponents should use attachedCallback instead of createdCallback. (#7102)
This commit is contained in:
@@ -36,7 +36,7 @@ class HelloMessage extends React.Component{
|
||||
|
||||
```javascript
|
||||
var proto = Object.create(HTMLElement.prototype, {
|
||||
createdCallback: {
|
||||
attachedCallback: {
|
||||
value: function() {
|
||||
var mountPoint = document.createElement('span');
|
||||
this.createShadowRoot().appendChild(mountPoint);
|
||||
|
||||
@@ -36,7 +36,7 @@ class HelloMessage extends React.Component{
|
||||
|
||||
```javascript
|
||||
var proto = Object.create(HTMLElement.prototype, {
|
||||
createdCallback: {
|
||||
attachedCallback: {
|
||||
value: function() {
|
||||
var mountPoint = document.createElement('span');
|
||||
this.createShadowRoot().appendChild(mountPoint);
|
||||
|
||||
Reference in New Issue
Block a user