Skip to content

Instantly share code, notes, and snippets.

@awebartisan
Created February 23, 2019 09:35
Show Gist options
  • Save awebartisan/1516cba00c4c0fb6d7e4301db182b488 to your computer and use it in GitHub Desktop.
Save awebartisan/1516cba00c4c0fb6d7e4301db182b488 to your computer and use it in GitHub Desktop.
Event Handler in parent component
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