Created
February 23, 2019 09:35
-
-
Save awebartisan/1516cba00c4c0fb6d7e4301db182b488 to your computer and use it in GitHub Desktop.
Event Handler in parent component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import ReactDOM from "react-dom"; | |
import { | |
AppProvider, | |
Page, | |
Card, | |
Layout, | |
} from "@shopify/polaris"; | |
import Wysiwyg from "./components/wysiwyg"; | |
export default class App extends React.Component { | |
state = { | |
content: "" | |
} | |
render(){ | |
return( | |
<AppProvider apiKey={apiKey} shopOrigin={shopOrigin} forceRedirect={true}> | |
<Page> | |
<Layout> | |
<Card> | |
<Wysiwyg onChange={this.handleContentChange} /> | |
</Card> | |
</Layout> | |
</Page> | |
</AppProvider> | |
); | |
} | |
handleContentChange = (content) => { | |
this.setState({content : content}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment