Created
November 19, 2018 10:49
-
-
Save queq1890/6e85cff6bc54fa167fa5569c9127bc0d to your computer and use it in GitHub Desktop.
use this component inside of Formik rendering
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 from 'react'; | |
const DisplayFormikState = props => { | |
const { values, errors, touched } = props; | |
return ( | |
<div style={{ margin: '1rem 0' }}> | |
<h3 style={{ fontFamily: 'monospace' }} /> | |
<pre | |
style={{ | |
background: '#f6f8fa', | |
fontSize: '.65rem', | |
padding: '.5rem' | |
}} | |
> | |
<strong>values</strong> = {JSON.stringify(values, null, 2)} | |
<strong>errors</strong> = {JSON.stringify(errors, null, 2)} | |
<strong>touched</strong> = {JSON.stringify(touched, null, 2)} | |
</pre> | |
</div> | |
); | |
}; | |
export default DisplayFormikState; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment