Skip to content

Typescript Props Type Definition for StateInspector is incompatible with children prop #83

@rogi29

Description

@rogi29

Description

Integrating the StateInspector into a strict TypeScript react project will fail at build time.
Inserting React Nodes as a children prop into the StateInspector component will result with a TypeError.
In my specific case I was trying to insert my App component as a children prop and got an error from my IDE.

Error message

image

Code Example

import { StateInspector } from "reinspect";
import { App } from "./app";

export const AppWrapper = () => {
  return (
    <StateInspector>
      <App />
    </StateInspector>
  );
}

Suggestion

After reviewing the source code, indeed the children prop was not defined and there was no use of the PropsWithChildren type.
This is absolutely necessary in my opinion, and I am willing to provide a solution and post a pull request to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions