Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mapTokensToProps,
}) => {
const [css, baseTheme] = useStyletron();
const componentTheme = getThemeFromContext(baseTheme, theme);
const themePrimitives =
baseTheme.name && baseTheme.name.startsWith('dark-theme')
? 'darkThemePrimitives'
: 'lightThemePrimitives';
const provider = getProvider(componentTheme, themePrimitives);
const {query, push, pathname} = useRouter();
const initialCode = (typeof queryStringName !== 'undefined'
? query[queryStringName]
: query.code) as string;
const params = useView({
componentName,
props,
scope: {
...scope,
ThemeProvider,
lightThemePrimitives,
darkThemePrimitives,
createTheme,
},
imports,
provider,
customProps,
initialCode,
onUpdate: ({code}) => {
const query = queryStringName || 'code';
push({