From 6709ffa0b590e6960052e73a4d1dd5918e458b37 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:52:30 +0000 Subject: [PATCH] style: format code with Prettier This commit fixes the style issues introduced in fd4dc02 according to the output from Prettier. Details: None --- md-docs/1.getting-started.md | 42 ++++++++++++++++----------------- md-docs/2.leveraging-plugins.md | 18 +++++++------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/md-docs/1.getting-started.md b/md-docs/1.getting-started.md index e951f864..6ec8f719 100644 --- a/md-docs/1.getting-started.md +++ b/md-docs/1.getting-started.md @@ -40,7 +40,7 @@ In some cases you might want to initialize the state with a function, for exampl ```tsx const [state, setState] = useRGS("counter", () => - typeof localStorage === "undefined" ? 1 : localStorage.getItem("counter") ?? 1, + typeof localStorage === "undefined" ? 1 : localStorage.getItem("counter") ?? 1, ); ``` @@ -59,13 +59,13 @@ import useRGS from "r18gs"; import { COUNTER } from "../constants/global-states"; export default function Display() { - const [count] = useRGS(COUNTER); - return ( -
-

Client Component 2

- {count} -
- ); + const [count] = useRGS(COUNTER); + return ( +
+

Client Component 2

+ {count} +
+ ); } ``` @@ -77,18 +77,18 @@ import useRGS from "r18gs"; import { COUNTER } from "../constants/global-states"; export default function Counter() { - const [count, setCount] = useRGS(COUNTER, 0); - return ( -
-

Client Component 1

- { - setCount(parseInt(e.target.value.trim())); - }} - type="number" - value={count} - /> -
- ); + const [count, setCount] = useRGS(COUNTER, 0); + return ( +
+

Client Component 1

+ { + setCount(parseInt(e.target.value.trim())); + }} + type="number" + value={count} + /> +
+ ); } ``` diff --git a/md-docs/2.leveraging-plugins.md b/md-docs/2.leveraging-plugins.md index e8bd53c2..f0c5f555 100644 --- a/md-docs/2.leveraging-plugins.md +++ b/md-docs/2.leveraging-plugins.md @@ -27,13 +27,13 @@ This function is beneficial if your requirements dictate that your `key` and/or import { useRGSWithPlugins } from "r18gs/dist/with-plugin"; export function MyComponent(props: MyComponentProps) { - const [state, setState] = useRGSWithPlugins( - props.key, - props.initialVal, - props.plugins, - props.doNotInit, - ); - // ... + const [state, setState] = useRGSWithPlugins( + props.key, + props.initialVal, + props.plugins, + props.doNotInit, + ); + // ... } ``` @@ -56,8 +56,8 @@ export const useMyRGS = withPlugins([plugin1, plugin2, ...]); ```tsx export function MyComponent(props: MyComponentProps) { - const [state, setState] = useMyRGS(props.key, props.initialVal, props.doNotInit); - // ... + const [state, setState] = useMyRGS(props.key, props.initialVal, props.doNotInit); + // ... } ```