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

feat(docz): spread remaining props to Props component #1276

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/docz/src/components/Props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface PropsProps {
isRaw?: boolean
isToggle?: boolean
of: ComponentWithDocGenInfo
[key: string]: any
}

export const getPropType = (prop: Prop) => {
Expand Down Expand Up @@ -98,13 +99,15 @@ export interface PropsComponentProps {
props: Record<string, Prop>
getPropType(prop: Prop): string
of: ComponentWithDocGenInfo
[key: string]: any
}

export const Props: SFC<PropsProps> = ({
title,
isToggle,
isRaw,
of: component,
...rest
}) => {
const components = useComponents()
const { props: stateProps } = React.useContext(doczState.context)
Expand Down Expand Up @@ -151,6 +154,7 @@ export const Props: SFC<PropsProps> = ({
props={props}
getPropType={getPropType}
of={component}
{...rest}
/>
)
}