Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Props destruct documentation doest work for some code #110

Closed
sudoerwx opened this issue Oct 16, 2020 · 3 comments
Closed

Props destruct documentation doest work for some code #110

sudoerwx opened this issue Oct 16, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@sudoerwx
Copy link

sudoerwx commented Oct 16, 2020

Try to generate doc for this code, it doesn’t work, but if you remove "true &&" or className it will work

const Test = ({ someVal }) => {
	return <div>{true && someVal ? <small className="helper-text">{someVal}</small> : null}</div>;
};
export default Test;

image

@sudoerwx sudoerwx added the bug Something isn't working label Oct 16, 2020
kkoomen added a commit that referenced this issue Oct 17, 2020
@kkoomen
Copy link
Owner

kkoomen commented Oct 17, 2020

This bug has been fixed and released in v3.2.9.

Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution.

@sudoerwx
Copy link
Author

sudoerwx commented Oct 20, 2020

@kkoomen I have updated the version but it still doesn’t work even if I run npm build manually, no output, nothing

seems like this code

const Test = ({ someVal }) => {
	return <div>{true && someVal ? <small className="helper-text">{someVal}</small> : null}</div>;
};

export default Test;

works only without export line

and this code doesn’t work too

const SomeWrapperComponent = ({ onSubmit, previewImages, onPreviewFileDelete, ...rest }) => {
	return true ? (
		<div
			onCancel={() => {
				setIsOpen(false);
			}}
			onSubmit={(...val) => {
				onSubmit(...val);
				setIsOpen(false);
			}}
			{...rest}
		/>
	) : (
		<div className="">
			<div className="">
				<SomeComponent
					files={previewImages?.map((image) => ({
						id: image?.id
					}))}
					onDelete={onPreviewFileDelete}
				/>
			</div>
		</div>
	);
};

or even this smaller version

const SomeWrapperComponent = ({ onSubmit, previewImages, onPreviewFileDelete, ...rest }) => {
	return (
		<div className="">
			<div className="">
				<SomeComponent
					files={previewImages?.map((image) => ({
						id: image?.id
					}))}
					onDelete={onPreviewFileDelete}
				/>
			</div>
		</div>
	);
};

@kkoomen
Copy link
Owner

kkoomen commented Oct 20, 2020

Apologies. I noticed I can simply use the TSX parser which supports seems to support TSX/JSX and every other syntastic sugar in JS/TS. This bug has been fixed and released in v3.2.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants