react-inspector icon indicating copy to clipboard operation
react-inspector copied to clipboard

[Bug] Theme type is wrong

Open uladzimir-miadzinski opened this issue 1 year ago • 1 comments

Describe the bug

It is impossible to override themes using "theme" attribute because of bug in types

Steps to reproduce the behavior

  1. Install latest 6.0.2
  2. Copy example from your docs https://www.npmjs.com/package/react-inspector#theme
import { chromeLight } from 'react-inspector'

<Inspector theme={{...chromeLight, ...({ TREENODE_PADDING_LEFT: 20 })}} data={{a: 'a', b: 'b'}}/>
  1. Add table={false} because now it is required attribute.
  2. See error that theme should be of type "string"

Expected behavior

Theme of type string | Record<string, string | number> | undefined.

Screenshots and/or logs

image

Environment

  • OS: Windows 10 x64
  • Node.js version: 20.10.0
  • NPM version: 10.2.3
  • Browser (if applicable): Latest Chrome

Additional context

p.s. the same happens if we try to use ObjectInspector

uladzimir-miadzinski avatar Feb 01 '24 17:02 uladzimir-miadzinski

Any thoughts on this one? I've dug through the whole object model and can't find a way to override things properly?

sethjuarez avatar Feb 27 '24 06:02 sethjuarez