question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Next] <Debug/> component

See original GitHub issue

Now that Formik uses context, a <Debug/> component is now possible.

Proof of concept: https://codesandbox.io/s/mrz25m138

  • Logs history
  • Can jump to states

Thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jaredpalmercommented, Sep 6, 2017

Worth examining perf implications… but we could get awesome debugging if we refactored internals to use a reducer pattern.

  reduce = (
    state: FormikState<any>,
    { type, payload }: { type: string; payload: any }
  ) => {
    switch (type) {
      case 'SET_ERRORS':
        return { ...state, errors: payload };
      case 'SET_STATUS':
        return { ...state, status: payload };
      case 'SET_TOUCHED':
        return { ...state, touched: payload };
      case 'SET_VALUES':
        return { ...state, values: payload };
      case 'SET_FIELD_VALUE':
        return { ...state, values: { ...state.values, ...payload } };
      case 'SET_FIELD_ERROR':
        return { ...state, errors: { ...state.errors, ...payload } };
      case 'SET_FIELD_TOUCHED':
        return { ...state, touched: { ...state.touched, ...payload } };
      case 'SET_SUBMITTING':
        return { ...state, isSubmitting: payload };
      default:
        return state;
    }
  };

  dispatch = (action: { type: string; payload: any }) => {
    this.setState((state: FormikState<any>) => this.reduce(state, action));
  };```
1reaction
aniedcommented, Sep 11, 2020

I know this is a three year old closed issue, but I’d love some debugging helpers built into the library-- I’m running into an issue where an error is being mysteriously unset and I am finding it very challenging to track where and why it is happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Features: Debugging - Next.js
This documentation explains how you can debug your Next.js frontend and backend code with full source maps support using either the VS Code...
Read more >
What is Next.JS and How to Debug it - HackerNoon
A Next.JS page has two parts: a server-side part and a client-side part. To debug both parts you will need two VSCode launch...
Read more >
Debugging Next.js App in Production - Requestly
So In this article, we will see how we can debug a Next.js application in production without even setting up a local server...
Read more >
Debugging Next.js Applications - DEV Community ‍ ‍
As a React meta-framework that executes in both Node.js and in the browser, Next.js is more complicated to debug than a typical browser-only ......
Read more >
Debug Next Experience - Product Documentation | ServiceNow
Debug your Next Experience instance to detect and remove existing and potential errors in your Next Experience components and script.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found