Created
April 25, 2019 05:03
-
-
Save de314/ad5752b88c326b91596fd25eeb840a25 to your computer and use it in GitHub Desktop.
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 from 'react'; | |
import { Field } from 'formik'; | |
import AceEditor from 'react-ace'; | |
import 'brace/mode/ejs'; | |
import 'brace/theme/textmate'; | |
export const EjsForm = ({ name }) => ( | |
<Field name={name}> | |
{({ field }) => ( | |
<React.Fragment> | |
<AceEditor | |
mode="ejs" | |
theme="textmate" | |
onChange={value => { | |
field.onChange(name)(value); | |
}} | |
tabSize={2} | |
editorProps={{ $blockScrolling: true }} | |
value={field.value} | |
width="100%" | |
/> | |
</React.Fragment> | |
)} | |
</Field> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment