Package Exports
- @miroiu/use-debug-panel
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@miroiu/use-debug-panel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
use-debug-panel
useDebugPanel provides a panel where you can modify properties of an object
Install
npm install @miroiu/use-debug-panel
Usage
import React from 'react';
import ReactDOM from 'react-dom';
import {
DebugPanelProvider,
makeSlider,
makeColor,
useDebugPanel,
} from '@miroiu/use-debug-panel';
const App: React.FC = () => {
const { string, slider } = useDebugPanel(
{
number: 1,
string: 'text',
boolean: true,
date: new Date(),
slider: makeSlider(10),
color: makeColor('#00aaff'),
function: () => alert('Hi'),
array: [1, 2, 4, 5],
object: {},
undefined: undefined,
null: null,
},
'Optional Title'
);
return (
<div>
{string}: {slider.value}
</div>
);
};
ReactDOM.render(
<DebugPanelProvider>
<App />
</DebugPanelProvider>,
document.getElementById('root')
);
License
MIT © miroiu