React-Reinspect: Use redux devtools to inspect useState and useReducer :mag_right:

reinspect

Under development

Connect React state hooks (useState and useReducer) to redux dev tools.

See it live

useState with Redux dev tools

Why?

Hooks are great, they are a joy to use to create state in components. On the other hand, with something global and centralised like Redux, we have great dev tools.

Why not both? That's exactly what this package offers: connecting useState and useReducer to redux dev tools, so you can do the following:

  • Inspect actions and state for each hook
  • Time travel through state changes in your app
  • Hot reloading: save your current state and re-inject it when re-rendering

API

You need redux devtools installed. This package provides:

  • StateInspector: a provider which will be used by useState and useReducer to connect them to a store and redux dev tools.

    • It accepts optionally a name (name of the store in dev tools) and initialState (if you want to start with a given state)
    • You can have more than one StateInspector in your application, hooks will report to the nearest one
    • Without a StateInspector, useState and useReducer behave normally
    import React from "react"
    import { StateInspector } from "reinspect"
    import App from "./App"
    
    function AppWrapper() {
        return (
            <StateInspector name="App">
                <App />
            </StateInspector>
        )
    }
    
    export default AppWrapper
  • useState(initialState, id?): like useState but with a 2nd argument id (a unique ID to identify it in dev tools). If no id is supplied, the hook won't be connected to dev tools.

    import React from "react"
    import { useState } from "reinspect"
    
    export function CounterWithUseState({ id }) {
        const [count, setCount] = useState(0, id)
    
        return (
            <div>
                <button onClick={() => setCount(count - 1)}>-</button>
                {count} <button onClick={() => setCount(count + 1)}>+</button>
            </div>
        )
    }
  • useReducer(reducer, initialState, initializer?, id?): like useReducer but with a 4th argument id (a unique ID to identify it in dev tools). If no id is supplied, the hook won't be connected to dev tools. You can use identity function (state => state) as 3rd parameter to mock lazy initialization.

Comments

  • Bump merge-deep from 3.0.2 to 3.0.3 in /example
    Bump merge-deep from 3.0.2 to 3.0.3 in /example

    Jun 7, 2021

    Bumps merge-deep from 3.0.2 to 3.0.3.

    Commits
    • 628ff47 3.0.3
    • cfbe20c run verb to generate README documentation
    • e370968 Merge pull request #17 from jonschlinkert/key-properties
    • 393e2cb adding a test to ensure using merge-deep for inheritance still works
    • c39b161 add test to ensure constructor is not cloned
    • 11e5dd5 add isValidKey function to ensure only valid keys are merged
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Can this be used when using use-immer?
    Can this be used when using use-immer?

    Jun 20, 2021

    use-immer exposes useImmerReducer, reinspect exposes useReducer. Are there any workarounds to get the two to play nicely?

    Reply
  • Bump path-parse from 1.0.6 to 1.0.7
    Bump path-parse from 1.0.6 to 1.0.7

    Aug 10, 2021

    Bumps path-parse from 1.0.6 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Bump path-parse from 1.0.6 to 1.0.7 in /example
    Bump path-parse from 1.0.6 to 1.0.7 in /example

    Aug 10, 2021

    Bumps path-parse from 1.0.6 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • If StateInspector is in React.StrictMode no output to redux devtools
    If StateInspector is in React.StrictMode no output to redux devtools

    Aug 30, 2021

    The following works:

      <StateInspector name="App">
        <React.StrictMode>
          <App />
        </React.StrictMode>
      </StateInspector>,
    
    

    The following does not:

      <React.StrictMode>
        <StateInspector name="App">
          <App />
        </StateInspector>
      </React.StrictMode>,
    
    

    Note that there is no error and the app works but there is no output in the redux devtools

    Reply
  • Bump tmpl from 1.0.4 to 1.0.5
    Bump tmpl from 1.0.4 to 1.0.5

    Sep 20, 2021

    Bumps tmpl from 1.0.4 to 1.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Bump tmpl from 1.0.4 to 1.0.5 in /example
    Bump tmpl from 1.0.4 to 1.0.5 in /example

    Sep 20, 2021

    Bumps tmpl from 1.0.4 to 1.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Bump url-parse from 1.4.7 to 1.5.3 in /example
    Bump url-parse from 1.4.7 to 1.5.3 in /example

    Oct 5, 2021

    Bumps url-parse from 1.4.7 to 1.5.3.

    Commits
    • ad44493 [dist] 1.5.3
    • c798461 [fix] Fix host parsing for file URLs (#210)
    • 201034b [dist] 1.5.2
    • 2d9ac2c [fix] Sanitize only special URLs (#209)
    • fb128af [fix] Use 'null' as origin for non special URLs
    • fed6d9e [fix] Add a leading slash only if the URL is special
    • 94872e7 [fix] Do not incorrectly set the slashes property to true
    • 81ab967 [fix] Ignore slashes after the protocol for special URLs
    • ee22050 [ci] Use GitHub Actions
    • d2979b5 [fix] Special case the file: protocol (#204)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Bump follow-redirects from 1.10.0 to 1.14.7 in /example
    Bump follow-redirects from 1.10.0 to 1.14.7 in /example

    Jan 13, 2022

    Bumps follow-redirects from 1.10.0 to 1.14.7.

    Commits
    • 2ede36d Release version 1.14.7 of the npm package.
    • 8b347cb Drop Cookie header across domains.
    • 6f5029a Release version 1.14.6 of the npm package.
    • af706be Ignore null headers.
    • d01ab7a Release version 1.14.5 of the npm package.
    • 40052ea Make compatible with Node 17.
    • 86f7572 Fix: clear internal timer on request abort to avoid leakage
    • 2e1eaf0 Keep Authorization header on subdomain redirects.
    • 2ad9e82 Carry over Host header on relative redirects (#172)
    • 77e2a58 Release version 1.14.4 of the npm package.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Bump shelljs from 0.8.3 to 0.8.5
    Bump shelljs from 0.8.3 to 0.8.5

    Jan 15, 2022

    Bumps shelljs from 0.8.3 to 0.8.5.

    Release notes

    Sourced from shelljs's releases.

    v0.8.5

    This was a small security fix for #1058.

    v0.8.4

    Small patch release to fix a circular dependency warning in node v14. See #973.

    Changelog

    Sourced from shelljs's changelog.

    Change Log

    Unreleased

    Full Changelog

    Closed issues:

    • find returns empty array even though directory has files #922
    • exec() should support node v10 (maxbuffer change) #915
    • grep exit status and extra newlines #900
    • Travis CI currently broken #893
    • Drop node v4 support #873
    • cp -Ru respects the -R but not the -u #808

    Merged pull requests:

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • Bump handlebars from 4.1.2 to 4.5.3 in /example
    Bump handlebars from 4.1.2 to 4.5.3 in /example

    Dec 28, 2019

    Bumps handlebars from 4.1.2 to 4.5.3.

    Changelog

    Sourced from handlebars's changelog.

    v4.5.3 - November 18th, 2019

    Bugfixes:

    • fix: add "no-prototype-builtins" eslint-rule and fix all occurences - f7f05d7
    • fix: add more properties required to be enumerable - 1988878

    Chores / Build:

    • fix: use !== 0 instead of != 0 - c02b05f
    • add chai and dirty-chai and sinon, for cleaner test-assertions and spies, deprecate old assertion-methods - 93e284e, 886ba86, 0817dad, 93516a0

    Security:

    • The properties __proto__, __defineGetter__, __defineSetter__ and __lookupGetter__ have been added to the list of "properties that must be enumerable". If a property by that name is found and not enumerable on its parent, it will silently evaluate to undefined. This is done in both the compiled template and the "lookup"-helper. This will prevent new Remote-Code-Execution exploits that have been published recently.

    Compatibility notes:

    • Due to the security-fixes. The semantics of the templates using __proto__, __defineGetter__, __defineSetter__ and __lookupGetter__ in the respect that those expression now return undefined rather than their actual value from the proto.
    • The semantics have not changed in cases where the properties are enumerable, as in:
    {
      __proto__: 'some string'
    }
    
    • The change may be breaking in that respect, but we still only increase the patch-version, because the incompatible use-cases are not intended, undocumented and far less important than fixing Remote-Code-Execution exploits on existing systems.

    Commits

    v4.5.2 - November 13th, 2019

    Bugfixes

    • fix: use String(field) in lookup when checking for "constructor" - d541378
    • test: add fluent API for testing Handlebars - c2ac79c

    Compatibility notes:

    • no incompatibility are to be expected
    ... (truncated)
    Commits
    • c819c8b v4.5.3
    • 827c9d0 Update release notes
    • f7f05d7 fix: add "no-prototype-builtins" eslint-rule and fix all occurences
    • 1988878 fix: add more properties required to be enumerable
    • 886ba86 test/chore: add chai/expect and sinon to "runtime"-environment
    • 0817dad test: add sinon as global variable to eslint in the specs
    • 93516a0 test: add sinon.js for spies, deprecate current assertions
    • 93e284e chore: add chai and dirty-chai for better test assertions
    • c02b05f fix: use !== 0 instead of != 0
    • 8de121d v4.5.2
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    Reply
  • how to get dispatch when not use useReducer (e.g.  component was unmount)
    how to get dispatch when not use useReducer (e.g. component was unmount)

    Sep 8, 2019

    if a ajax request was finished after component was unmount, the dispatch, was loss, and the ajax result can't apply to reducer

    Reply
  • issue #28 resolve missing types
    issue #28 resolve missing types

    Jan 29, 2020

    types location is now defined for typescript inference

    Reply
  • Crashes when Redux Devtools Chrome extension is not installed
    Crashes when Redux Devtools Chrome extension is not installed

    Jul 24, 2019

    When I view my app with the Redux Devtools Chrome extension installed, it works fine. I use useReducer, and see the events showing up in the devtools as I'd expect.

    When the extension is not installed, I get a crash. I haven't been able to fully diagnose the issue, but it is problematic that this line returns null:

    // function useReducer compiled source
    
    var store = useContext(StateInspectorContext); // ==> null
    

    The full stack trace is:

    Uncaught TypeError: Cannot read property 'getState' of null
        at index.es.js:104
        at mountMemo (react-dom.development.js:13964)
        at Object.useMemo (react-dom.development.js:14185)
        at useMemo (react.development.js:1525)
        at useHookedReducer (index.es.js:103)
        at useReducer (index.es.js:165)
        at useBuildDetails (useBuildDetails.ts:80)
        at BuildDetails (BuildDetails.tsx:35)
        at renderWithHooks (react-dom.development.js:13449)
        at mountIndeterminateComponent (react-dom.development.js:15605)
        at beginWork (react-dom.development.js:16238)
        at performUnitOfWork (react-dom.development.js:20279)
        at workLoop (react-dom.development.js:20320)
        at HTMLUnknownElement.callCallback (react-dom.development.js:147)
        at Object.invokeGuardedCallbackDev (react-dom.development.js:196)
        at invokeGuardedCallback (react-dom.development.js:250)
        at replayUnitOfWork (react-dom.development.js:19503)
        at renderRoot (react-dom.development.js:20433)
        at performWorkOnRoot (react-dom.development.js:21357)
        at performWork (react-dom.development.js:21267)
        at performSyncWork (react-dom.development.js:21241)
        at requestWork (react-dom.development.js:21096)
        at scheduleWork (react-dom.development.js:20909)
        at scheduleRootUpdate (react-dom.development.js:21604)
        at updateContainerAtExpirationTime (react-dom.development.js:21630)
        at updateContainer (react-dom.development.js:21698)
        at ReactRoot.push../node_modules/react-dom/cjs/react-dom.development.js.ReactRoot.render (react-dom.development.js:22011)
        at react-dom.development.js:22163
        at unbatchedUpdates (react-dom.development.js:21486)
        at legacyRenderSubtreeIntoContainer (react-dom.development.js:22159)
        at Object.render (react-dom.development.js:22234)
        at Module../src/index.tsx (index.tsx:7)
        at __webpack_require__ (bootstrap:781)
        at fn (bootstrap:149)
        at Object.0 (serviceWorker.js:135)
        at __webpack_require__ (bootstrap:781)
        at checkDeferredModules (bootstrap:45)
        at Array.webpackJsonpCallback [as push] (bootstrap:32)
        at main.chunk.js:1
    

    I am not able to repro this issue with a freshly created create-react-app, nor with your demo, so clearly something in my app (which I'm not able to share) is contributing to this issue. So, do what you will with this report. :smile:

    Reply
  • @@init on redux devtools does not have the initial state
    @@init on redux devtools does not have the initial state

    Jul 18, 2019

    on the demo, the initialstate is not stored untill a single setState() or dispatch() function is invoked. if i use time travel debugging to go back to @@init the state tree goes null on the webpage

    image

    Reply
  • Why is type of initial state a function?
    Why is type of initial state a function?

    Apr 24, 2019

    I see that the typings of the setState signature first parameter is a function, even when in the examples, an object is passed. Any clue?

    Reply
  • fix action.type check
    fix action.type check

    Oct 21, 2019

    Didn't get what action.type is for, but got exception with useState(null).

    Reply
  • #5 Fixed typing for the initial state in useState
    #5 Fixed typing for the initial state in useState

    Apr 26, 2019

    Fixed the types for the initial state from useState hook. I used the official types from react. (Line 846)

    Reply
  • fix: dispatch initial action to add initial state
    fix: dispatch initial action to add initial state

    Jul 23, 2019

    I have added a useEffect hook on the StateInspector component to pass a mock-dispatch to the redux store. This will add the intialState from each child useState() and useReducer() component to Redux Dev Tools on page load.

    all the local jest tests passed and i confirmed functionality on the example project.

    I haven't learned how to handle/override the @@INIT, i'm still looking into that specific scenario.

    Reply
  • fix: deps bump and react 16.8 compatibility
    fix: deps bump and react 16.8 compatibility

    Feb 6, 2019

    Hello, cool tool! :smile:

    I've always been on the 'you may not need redux' side, but with hooks api I may give it a try.

    So react 16.8 was released few hours ago and your package (as-is) unfortunately throws invariant violations (code-sandbox example does it too :warning: ).

    But I really, really wanted to try it so here's a fix^^

    • Updated reducer typing, because signature changed
    • Added init param to match 16.8 interface, so id param in hooks unfortunately need to go to the fourth place (needs docs update)
    • Refactored useContext hooks from useMemo body
    • Deps bump to latest

    Suggestions:

    • Change hooks signature a bit to allow undefined instead of identity (state => state) for third param?
    • Reuse original react typings more because there are cool overloads?

    In case anyone googling for a quick fix: yarn add vadistic/reinspect#reinspect-v0.4.3-gitpkg

    Reply