
Дмитрий
09.09.2018
18:25:10
Подскажите плиз , я SC храню в файле styles.js и импортирую стили в моем Header компоненте, я создал кнопку для шапки.
Сделал проект, в DOM много элементов.
навожу на кнопку и с F12 там такое: styles__Container
т.е. SC берет название файла где лежит описанный SC и потом уже название SC.
Можно ли как-нибдуь расширить информацию?
Что бы было типа такого: index__App__Header__styles__Container

D0rkD3n
09.09.2018
18:34:51
доброго времени!
нужна помощь по сторибуку
есть рабочий сайт на реакте и тайпскрипте, нужно туда докинуть еще сторибук, настроил как в доке, но все равно ошибка Error: The 'decorators' plugin requires a `decoratorsBeforeExport' option, whose value must be a boolean.. Гугл ничего дельного не выдает
.storybook/config.js
import React from 'react';
import { storiesOf } from '@storybook/react';
storiesOf('MyComponent', module)
.addDecorator(story => (<div>123</div>))
.storybook/webpack.config.js
const path = require("path");
const TSDocgenPlugin = require("react-docgen-typescript-webpack-plugin");
module.exports = (baseConfig, env, config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve("awesome-typescript-loader")
});
config.plugins.push(new TSDocgenPlugin()); // optional
config.resolve.extensions.push(".ts", ".tsx");
return config;
};
tsconfig.json
{
"compilerOptions": {
"baseUrl": "src",
"outDir": "./dist/",
"target": "es5",
"sourceMap": true,
"declaration": true,
"strict": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"module": "commonjs",
"moduleResolution": "node",
"alwaysStrict": false,
"allowJs": false,
"jsx": "react",
"rootDirs": ["src", "stories"],
"lib": ["es5", "es6", "es7", "es2017", "dom"],
"typeRoots": ["./node_modules/@types", "./typings"],
"typescript_tsdk":"/usr/lib/node_modules/typescript/lib",
"experimentalDecorators": true
"paths": {
"@components/*": ["src/components/*"],
"@containers/*": ["src/containers/*"],
"@utils/*": ["src/utils/*"],
"@styles/*": ["src/styles/*"],
"@hoc/*": ["src/hoc/*"],
"@icons/*": ["src/icons/*"],
"@graphql/*": ["src/graphql/*"]
},
"plugins": [
{
"name": "typescript-styled-plugin"
},
{
"name": "ts-graphql-plugin",
"tag": "gql"
}
]
},
"include": ["src/**/*", "typings", "custom.d.ts"]
}
sroties/index.js
import { storiesOf } from "@storybook/react";
const stories = storiesOf("Components", module);
import { action } from '@storybook/addon-actions';
stories.add(
"Test",
() => <div>123</div>
);
помогите плес

М
09.09.2018
18:38:32
ребят, а кто-нибудь знает, как на select теге сделать открытие дропдауна после фокуса?
то есть если у меня this.x = <select></select>, и я делаю this.x.focus(), то появляется аутлайн, что полностью бесполезно. нужно открывать дропдаун

D0rkD3n
09.09.2018
18:40:36
сек
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": ["last 2 versions"]
}
}
],
[
"@babel/stage-1",
{
"decoratorsLegacy": true
}
],
"@babel/react",
"@babel/typescript"
],
"plugins": [
"react-hot-loader/babel",
"styled-components",
"graphql-tag",
[
"@babel/plugin-transform-runtime",
{
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "@babel/runtime"
}
]
]
}
я тут пытался прописывать