<Props of={MyComponent} /> doesn鈥檛 render anything until I change and save the component鈥榮 file. While this is annoying locally, it breaks the static build.
Happens with a clean npm project with only docs installed.
index.mdx:
import Test from "./Test.js";
import { Props } from "docz";
# Yay
lorem ipsum huhuhu
<Test>yay</Test>
<Props of={Test} />
Test.js:
import React from "react";
import PropTypes from "prop-types";
const Test = ({ children, className }) => {
return <p className={className}>1 {children} 2</p>;
};
Test.propTypes = {
/** Additional className for container */
className: PropTypes.string
};
export default Test;
Expected behavior
Props table should render
Environment
@pedronauck here's a repo that reproduces this issue:
https://github.com/klujanrosas/docz-error-repro
Tested this on
Node v10.12.0 - Linux PopOS 18.04 LTS
And on
Node v10.15.3 - Windows 10
@klujanrosas,
Problem due to very strict filtering of component files on initial build. In watch mode only keys are compared. You need one of two things:
Perfect! Number 2 in @ejuo 's comment worked for me :) Thanks so much
@ejuo's comment worked for me in dev, but not for build. Super confused by this.
Does this refer to v1 of docz?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@klujanrosas,
Problem due to very strict filtering of component files on initial build. In watch mode only keys are compared. You need one of two things: