Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import { ThemeProvider } from 'styled-components'
import { getQueryParam } from '@storybook/client-api';
const currentThemeValueFromUrl = getQueryParam('currentTheme');
export default class WrapStory extends React.Component {
constructor(props) {
super(props)
const keys = Object.keys(props.themes)
this.state = {theme: props.themes[currentThemeValueFromUrl || keys[0]]}
this.updateState = this.updateState.bind(this)
}
componentDidMount() {
this.props.channel.emit('storybook-styled-components:init', this.props.themes)
this.props.channel.on('storybook-styled-components:update', this.updateState)
}
componentWillUnmount() {