From b98f2a712f0ec22e38bf90b3941a0caa32fab5a7 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sun, 21 May 2023 17:35:47 +0800 Subject: [PATCH] docs: wrap code examples with code block --- src/component.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/component.tsx b/src/component.tsx index fe6e894..9b20621 100644 --- a/src/component.tsx +++ b/src/component.tsx @@ -18,17 +18,21 @@ interface ComponentReactivity { * that it can re-render when the reactive value changes. * * @example Simple usage of `makeReactive`. + * ```ts * export default makeReactive(function App() { * const state = useReactive({ count: 1 }); * return

{state.count}

; * }); + * ``` * * @example Once a component is made reactive, it may access reactive values from any sources, not just from props, contexts and hooks. + * ```ts * import { reactiveState } from './anotherFile'; * * export default makeReactive(function App() { * return

{reactiveState.count}

; * }); + * ``` * * @param component The functional component to be made reactive. * @returns A reactive functional component.