Skip to content

Instantly share code, notes, and snippets.

@awebartisan
Last active February 23, 2019 09:34
Show Gist options
  • Save awebartisan/48c7991f2d4c9871bc6d1510c2919e8e to your computer and use it in GitHub Desktop.
Save awebartisan/48c7991f2d4c9871bc6d1510c2919e8e to your computer and use it in GitHub Desktop.
Wysiwyg Trix Editor React JSX
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 />
</Card>
</Layout>
</Page>
</AppProvider>
);
}
}
import React, { Component } from "react";
import Trix from "trix";
class Wysiwyg extends React.Component {
render() {
return (
<div>
<input
type="hidden"
id="trix"
/>
<trix-editor input="trix" />
</div>
);
}
}
export default Wysiwyg;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment