Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-cosmos-renderer

Package Overview
Dependencies
Maintainers
1
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cosmos-renderer - npm Package Compare versions

Comparing version 6.0.3 to 6.0.4-canary.2314a55.0

4

dist/fixture/useSelect/index.js

@@ -7,2 +7,6 @@ import { useCreateFixtureState } from './useCreateFixtureState.js';

throw new Error('No options provided to useSelect');
if (typeof args.options[0] === 'object') {
if (!args.options[0].options.length)
throw new Error('No options provided to useSelect');
}
useCreateFixtureState(selectName, args);

@@ -9,0 +13,0 @@ const currentValue = useCurrentValue(selectName, args);

@@ -0,3 +1,7 @@

type GroupedOptions<Option extends string> = {
group: string;
options: Option[];
};
export type UseSelectArgs<Option extends string> = {
options: Option[];
options: Option[] | GroupedOptions<Option>[];
defaultValue?: Option;

@@ -7,1 +11,2 @@ };

export declare function getDefaultSelectValue<Option extends string>({ options, defaultValue, }: UseSelectArgs<Option>): Option;
export {};
export function getDefaultSelectValue({ options, defaultValue, }) {
return typeof defaultValue === 'string' ? defaultValue : options[0];
if (typeof defaultValue === 'string') {
return defaultValue;
}
const [firstOption] = options;
if (typeof firstOption === 'object') {
return firstOption.options[0];
}
return firstOption;
}

2

dist/fixture/useSelect/useCreateFixtureState.js

@@ -28,3 +28,3 @@ import { useEffect } from 'react';

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [String(args.options), defaultValue, selectName, setFixtureState]);
}, [JSON.stringify(args.options), defaultValue, selectName, setFixtureState]);
}
{
"name": "react-cosmos-renderer",
"version": "6.0.3",
"version": "6.0.4-canary.2314a55.0+2314a55",
"description": "React Cosmos Renderer",

@@ -15,6 +15,6 @@ "repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-renderer",

"lodash-es": "4.17.21",
"react-cosmos-core": "^6.0.1",
"react-cosmos-core": "6.0.4-canary.2314a55.0+2314a55",
"react-is": "18.2.0"
},
"gitHead": "a046d36222582e9750fc23fee9eaeed146f44633"
"gitHead": "2314a552ecb325a7601415058f5dac67df41fe41"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc