Skip to content

Commit

Permalink
Pass level to custom components
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaslins committed Nov 17, 2020
1 parent 1429126 commit a40df02
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.9.1",
"version": "0.9.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ export const Block: React.FC<Block> = props => {
<CustomComponent
renderComponent={renderComponent}
blockValue={blockValue as BlockValueProp<typeof blockValue.type>}
level={level}
>
{children}
</CustomComponent>
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ export type BlockValueProp<T> = Extract<BlockValueType, { type: T }>;
export interface CustomBlockComponentProps<T extends BlockValueTypeKeys> {
renderComponent: () => JSX.Element | null;
blockValue: T extends BlockValueType ? BlockValueProp<T> : BaseValueType;
level: number;
}

export type CustomBlockComponents = {
Expand Down

0 comments on commit a40df02

Please sign in to comment.