<commit_before>import * as React from 'react';
import { FormikContext } from './types';

const PrivateFormikContext = React.createContext<FormikContext<any>>({} as any);
export const FormikProvider = PrivateFormikContext.Provider;
export const FormikConsumer = PrivateFormikContext.Consumer;

export function useFormikContext<Values>() {
  return React.useContext<FormikContext<Values>>(PrivateFormikContext);
}<commit_msg>Warn when using useFormikContext() without ctx<commit_after>import * as React from 'react';
import { FormikContext } from './types';
import invariant from 'tiny-warning';

const PrivateFormikContext = React.createContext<FormikContext<any>>({} as any);
export const FormikProvider = PrivateFormikContext.Provider;
export const FormikConsumer = PrivateFormikContext.Consumer;

export function useFormikContext<Values>() {
  const formik = React.useContext<FormikContext<Values>>(PrivateFormikContext);

  invariant(
    !formik,
    `Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component.`
  );

  return formik;
}
{'fraction_non_alphanumeric': 0.10155535224153706, 'fraction_numerical': 0.0, 'mean_word_length': 6.870503597122302, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4893330', 'n_tokens_mistral': 299, 'n_tokens_neox': 296, 'n_words': 84}