Skip to content

Instantly share code, notes, and snippets.

@queq1890
Created November 19, 2018 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save queq1890/6e85cff6bc54fa167fa5569c9127bc0d to your computer and use it in GitHub Desktop.
Save queq1890/6e85cff6bc54fa167fa5569c9127bc0d to your computer and use it in GitHub Desktop.
use this component inside of Formik rendering
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