getValue this function in <PropsTable> causing error
Describe the bug
Once include PropsTable component in my mdx file it throw error
To Reproduce
PropsTable as describeUncaught TypeError: Cannot read property 'replace' of undefined at getValue
Expected behavior
To see the <PropsTable> with correct props defined in ../lib/Button/index.js
Enviroment
{
"engines": {
"node": "8.11.1",
"npm": "5.7.1",
"yarn": "1.6.0"
}
}
Additional context/Screenshots


Hey @louis-pvs I'm having the same problem.
I belive that problem is PropTypes.oneOfType. If you stop use it, the error not is shown.
I didn't try <PropsTable> using oneOfType in prop types, I will see what's happening. Thanks guys 鉁岋笍
Similar issue with .instanceOf:
propTypes = {
date: PropTypes.instanceOf(Date),
}
Should I open another issue for this?
@albinekb the problem is similar, so i believe we can keep it here.
these also have the same problem:
propTypes = {
optionalMessage: PropTypes.instanceOf(Message),
optionalEnum: PropTypes.oneOf(['News', 'Photos']),
optionalUnion: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.instanceOf(Message)
]),
optionalArrayOf: PropTypes.arrayOf(PropTypes.number),
optionalObjectOf: PropTypes.objectOf(PropTypes.number),
optionalObjectWithShape: PropTypes.shape({
color: PropTypes.string,
fontSize: PropTypes.number
}),
}
I started work on that bug.
@renatorib I made my own, if you want to have a look: https://gist.github.com/albinekb/f59feb84273279d1d45f603aee8eb496
Looks great @albinekb
Most helpful comment
I didn't try
<PropsTable>usingoneOfTypein prop types, I will see what's happening. Thanks guys 鉁岋笍