Last active
February 23, 2019 09:34
-
-
Save awebartisan/48c7991f2d4c9871bc6d1510c2919e8e to your computer and use it in GitHub Desktop.
Wysiwyg Trix Editor React JSX
This file contains 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 /> | |
</Card> | |
</Layout> | |
</Page> | |
</AppProvider> | |
); | |
} | |
} |
This file contains 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 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