Comments (6)
Addon docs is working well with this webpack configuration if some need
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env',
'@babel/preset-typescript',
'@babel/preset-react',
]
}
},
'react-docgen-typescript-loader'
]
});
config.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
};
from react-docgen-typescript-loader.
Same, even with @storybook/typescript-preset.
from react-docgen-typescript-loader.
Same here; even using babel-loader. Did anyone manage to make it work?
Not using CRA here. Using latest React and Typscript.
from react-docgen-typescript-loader.
I'm having the exact same problem. I'm using the latest versions of TS, Storybook (+ relevant plugins), React. I've tried with babel-loader, ts-loader, and awesome-typescript-loader. That was working before and was started in 5.1 if I'm not mistaken.
from react-docgen-typescript-loader.
@gal1419 I also seen when you don't export component directly I say this error. Cau you try this:
import React from "react";
import './Button.scss';
interface FancyButtonProps {
/**
* onPress function handler
*/
click?: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
/**
* Set disabled button
*/
disabled: boolean;
/**
* Text displayed in button
*/
text: string;
/**
* CSS properties to apply to button
*/
style?: React.CSSProperties;
}
/**
* The world's most beautiful button
*/
export const FancyButton = ({disabled = false, text = 'Click me', style, click}: FancyButtonProps) => (
<button disabled={disabled} style={style} className='fancy-button' onClick={click}>
{text}
</button>
);
export default FancyButton;
With config I mentionned previously
from react-docgen-typescript-loader.
@gregoryBernard thanks for the info, however, we don't use default exports, so that is not an option for us.
from react-docgen-typescript-loader.
Related Issues (20)
- Discrepancy with ts-loader in monorepos
- Failure to describe props defined externally (without a corresponding component) HOT 1
- There is a bug when my filename is "switch" HOT 2
- React-native support ?
- Failed to launch - TypeError: Cannot read property 'getSourceFile' of undefined HOT 1
- Code fails when using displayName that contains invalid characters or reserved words HOT 4
- Missing peerDependency for @webpack-contrib/schema-utils
- Doesn't support union types HOT 7
- Crashing and performance issues with storybook 5.3 HOT 4
- Typescript errors HOT 6
- Importing component defined in index breaks the docgen HOT 1
- Component description detection doesn't work well with the Component Story Format (CSF) HOT 1
- The component file Name should be Capital Case to show Props
- Output more information on union types in prop values HOT 2
- Reversal of 3.7.0 HOT 3
- defaultValue value without double quotes
- question about customization of page layout? HOT 1
- Inline subtype shape inferred as "signature" HOT 1
- Looking for maintainer
- Can the loader use *.js+*.d.ts and work without TS source files and without ts-loader? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-docgen-typescript-loader.