Skip to content

Commit

Permalink
docs: wrap code examples with code block
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed May 21, 2023
1 parent e891ac9 commit b98f2a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ interface ComponentReactivity {
* that it can re-render when the reactive value changes.
*
* @example <caption>Simple usage of `makeReactive`.</caption>
* ```ts
* export default makeReactive(function App() {
* const state = useReactive({ count: 1 });
* return <p>{state.count}</p>;
* });
* ```
*
* @example <caption>Once a component is made reactive, it may access reactive values from any sources, not just from props, contexts and hooks.</caption>
* ```ts
* import { reactiveState } from './anotherFile';
*
* export default makeReactive(function App() {
* return <p>{reactiveState.count}</p>;
* });
* ```
*
* @param component The functional component to be made reactive.
* @returns A reactive functional component.
Expand Down

0 comments on commit b98f2a7

Please sign in to comment.