fix(react): FrameworkDelegate matches API

This commit is contained in:
Kevin Groat
2018-04-11 10:31:07 -04:00
committed by Manu MA
parent 2c9d485d2d
commit e40a6b0e94
3 changed files with 4163 additions and 8 deletions

4160
react/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -34,8 +34,7 @@
"devDependencies": { "devDependencies": {
"@ionic/core": "next", "@ionic/core": "next",
"react": "latest", "react": "latest",
"react-dom": "latest", "react-dom": "latest"
"typescript": "~2.5.2"
}, },
"dependencies": { "dependencies": {
"@stencil/core": "next" "@stencil/core": "next"

View File

@ -16,13 +16,9 @@ export function attachViewToDom(parentElement: HTMLElement, reactComponent: any,
// mount the React component // mount the React component
const reactElement = React.createElement(reactComponent, propsOrData); const reactElement = React.createElement(reactComponent, propsOrData);
const mountedComponentInstance = ReactDOM.render(reactElement, wrappingDiv); ReactDOM.render(reactElement, wrappingDiv);
return Promise.resolve({ return Promise.resolve(wrappingDiv);
element: wrappingDiv,
reactElement: reactElement,
instance: mountedComponentInstance
});
} }
export function removeViewFromDom(parentElement: HTMLElement, childElement: HTMLElement): Promise<any> { export function removeViewFromDom(parentElement: HTMLElement, childElement: HTMLElement): Promise<any> {