storybookjs / react-inspector

🔍 Power of Browser DevTools inspectors right inside your React app
https://5d8cb665bc622e0020296079-dippbxxgcq.chromatic.com/
MIT License
774 stars 95 forks source link

[Bug] Theme type is wrong #179

Open uladzimir-miadzinski opened 9 months ago

uladzimir-miadzinski commented 9 months ago

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
  3. 
    import { chromeLight } from 'react-inspector'

<Inspector theme={{...chromeLight, ...({ TREENODE_PADDING_LEFT: 20 })}} data={{a: 'a', b: 'b'}}/>


4. Add `table={false}` because now it is required attribute.
5. 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](https://github.com/storybookjs/react-inspector/assets/8378842/86f10de8-45b1-4e30-aa5f-6c7a1c499820)

### 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`
sethjuarez commented 9 months ago

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

eranimo commented 6 days ago

Seems like a huge regression?