Skip to content

Commit c291871

Browse files
committed
Pass inline prop to custom render function
1 parent 535767b commit c291871

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/index.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ describe('useLog', () => {
363363
isCollapsed: false,
364364
isGrouped: true,
365365
},
366+
inline: true,
366367
prevValue: undefined,
367368
type: 'Mount',
368369
value: 'Test',

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export type UseLogConfig = {
4242
/** Contains custom implementation of console */
4343
printer?: Printer | Console
4444
logLevel?: LogLevels
45-
/** Custom function which will be used for rendering the result, provided with useful data */
46-
render?: <T>(props: RenderProps<T>) => void
4745
/** Render object or array inline or via interactive browser renderer */
4846
inline?: boolean
47+
/** Custom function which will be used for rendering the result, provided with useful data */
48+
render?: <T>(props: RenderProps<T>) => void
4949
} & (
5050
| {
5151
/** Enable grouping for logs */
@@ -78,7 +78,7 @@ export interface UseLogReturn {
7878
/** Describes input parameters for custom printer function */
7979
export type RenderProps<T> = Pick<
8080
_PrintConfig<T>,
81-
'value' | 'prevValue' | 'type' | 'componentName'
81+
'value' | 'prevValue' | 'type' | 'componentName' | 'inline'
8282
> & {
8383
flags?: Pick<_PrintFlags, 'isGrouped' | 'isCollapsed'>
8484
}

src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export function getRenderFunctionProps<T>(
9696
prevValue: props.prevValue,
9797
type: props.type,
9898
componentName: props.componentName,
99+
inline: props.inline,
99100
flags: {
100101
isGrouped: props.flags?.isGrouped,
101102
isCollapsed: props.flags?.isCollapsed,

0 commit comments

Comments
 (0)