Skip to content

Commit df95638

Browse files
authored
Merge pull request #53 from pyk/CustomBlockComponent
Pass currentBlock to CustomBlockComponent
2 parents 4d663f1 + dbca971 commit df95638

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/block.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ export const Block: React.FC<Block> = props => {
505505
return (
506506
<CustomComponent
507507
renderComponent={renderComponent}
508+
blockMap={blockMap}
508509
blockValue={blockValue as BlockValueProp<typeof blockValue.type>}
509510
level={level}
510511
>

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ export type BlockValueProp<T> = Extract<BlockValueType, { type: T }>;
346346

347347
export interface CustomBlockComponentProps<T extends BlockValueTypeKeys> {
348348
renderComponent: () => JSX.Element | null;
349+
blockMap: BlockMapType;
349350
blockValue: T extends BlockValueType ? BlockValueProp<T> : BaseValueType;
350351
level: number;
351352
}

0 commit comments

Comments
 (0)