You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also use `bind:propertyName` to conveniently have a [two-way binding](/docs/(qwik)/components/rendering/index.mdx#bind-attribute) between a signal and an input element.
60
+
You can also use `bind:propertyName` to conveniently have a [two-way binding](/docs/(qwik)/core/rendering/index.mdx#bind-attribute) between a signal and an input element.
61
61
62
62
Notice that `onClick$` ends with [`$`](/docs/(qwik)/advanced/dollar/index.mdx). This is a hint to both the [Optimizer](/docs/(qwik)/advanced/optimizer/index.mdx) and the developer that a special transformation occurs at this location. The presence of the `$` suffix implies a lazy-loaded boundary here. The code associated with the `click` handler is not loaded into the JavaScript Virtual Machine (VM) until the user activates the click event. However, to avoid delays during the first interaction, it is eagerly loaded into the browser cache.
> **NOTE** For reactivity to work as expected, make sure to keep a reference to the reactive object and not only to its properties. e.g. doing `let { count } = useStore({ count: 0 })` and then mutating `count` won't trigger updates of components that depend on the property.
125
125
126
-
Because [`useStore()`](/docs/(qwik)/components/state/index.mdx#usestore) tracks deep reactivity, that means that Arrays and Objects inside the store will also be reactive.
126
+
Because [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) tracks deep reactivity, that means that Arrays and Objects inside the store will also be reactive.
@@ -225,10 +225,10 @@ In Qwik, there are two ways to create computed values, each with a different use
225
225
226
226
1.`useComputed$()`: `useComputed$()` is the preferred way of creating computed values. Use it when the computed value can be derived synchronously purely from the source state (current application state). For example, creating a lowercase version of a string or combining first and last names into a full name.
227
227
228
-
2.[`useResource$()`](/docs/(qwik)/components/state/index.mdx#useresource): `useResource$()` is used when the computed value is asynchronous or the state comes from outside of the application. For example, fetching the current weather (external state) based on a current location (application internal state).
228
+
2.[`useResource$()`](/docs/(qwik)/core/state/index.mdx#useresource): `useResource$()` is used when the computed value is asynchronous or the state comes from outside of the application. For example, fetching the current weather (external state) based on a current location (application internal state).
229
229
230
230
231
-
In addition to the two ways of creating computed values described above, there is also a lower-level ([`useTask$()`](/docs/(qwik)/components/tasks/index.mdx#usetask)). This way does not produce a new signal, but rather modifies the existing state or produces a side effect.
231
+
In addition to the two ways of creating computed values described above, there is also a lower-level ([`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask)). This way does not produce a new signal, but rather modifies the existing state or produces a side effect.
232
232
233
233
### `useComputed$()`
234
234
@@ -390,7 +390,7 @@ The state `resource.loading` can be one of the following:
390
390
-`false` - the data is not yet available.
391
391
-`true` - the data is available. (Either resolved or rejected.)
392
392
393
-
The callback passed to [`useResource$()`](/docs/(qwik)/components/state/index.mdx#useresource) runs right after the [`useTask$()`](/docs/(qwik)/components/tasks/index.mdx#usetask) callbacks complete. Please refer to the [Lifecycle](../tasks/index.mdx#lifecycle) section for more details.
393
+
The callback passed to [`useResource$()`](/docs/(qwik)/core/state/index.mdx#useresource) runs right after the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) callbacks complete. Please refer to the [Lifecycle](../tasks/index.mdx#lifecycle) section for more details.
Copy file name to clipboardExpand all lines: packages/docs/src/routes/docs/(qwik)/core/styles/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -479,7 +479,7 @@ The problem with this approach is that we will load styles twice.
479
479
1. The styles are inserted into the HTML as part of the SSR.
480
480
2. Then when the component is invalidated and needs to be re-rendered, the styles are loaded again because they are inlined.
481
481
482
-
What is needed is to load the styles independently from the component. This is what [`useStyles$()`](/docs/(qwik)/components/styles/index.mdx#usestyles) is for. There are two scenarios:
482
+
What is needed is to load the styles independently from the component. This is what [`useStyles$()`](/docs/(qwik)/core/styles/index.mdx#usestyles) is for. There are two scenarios:
483
483
484
484
1. The component is rendered on the server and the styles are inserted into `<head>` as part of the SSR.
485
485
- Adding a new instance of a component to the application does not require that we load the styles as they are already included as part of SSR.
Copy file name to clipboardExpand all lines: packages/docs/src/routes/docs/(qwik)/core/tasks/index.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ When the user interacts with the application, it resumes on the client-side, con
93
93
94
94
`useTask$()` registers a hook to be executed upon component creation, it will run at least once either in the server or in the browser, depending on where the component is initially rendered.
95
95
96
-
Additionally, this task can be reactive and will re-execute when **tracked**[state](/docs/(qwik)/components/state/index.mdx) changes.
96
+
Additionally, this task can be reactive and will re-execute when **tracked**[state](/docs/(qwik)/core/state/index.mdx) changes.
97
97
98
98
**Notice that any subsequent re-execution of the task will always happen in the browser**, because reactivity is a browser-only thing.
Sometimes a task needs to run only on the browser and after rendering, in that case, you should use `useVisibleTask$()`. The `useVisibleTask$()` is similar to `useTask$()` but it only runs on the browser and after initial rendering. `useVisibleTask$()` registers a hook to be executed when the component becomes visible in the viewport, it will run at least once in the browser, and it can be reactive and re-execute when some **tracked**[state](/docs/(qwik)/components/state/index.mdx) changes.
326
+
Sometimes a task needs to run only on the browser and after rendering, in that case, you should use `useVisibleTask$()`. The `useVisibleTask$()` is similar to `useTask$()` but it only runs on the browser and after initial rendering. `useVisibleTask$()` registers a hook to be executed when the component becomes visible in the viewport, it will run at least once in the browser, and it can be reactive and re-execute when some **tracked**[state](/docs/(qwik)/core/state/index.mdx) changes.
Copy file name to clipboardExpand all lines: packages/docs/src/routes/docs/(qwik)/faq/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ We also have an interactive [tutorial](../../tutorial/welcome/overview/) to get
72
72
73
73
## What are all those `$` signs?
74
74
75
-
You might have noticed there are more [`$`](../advanced/dollar/index.mdx) signs than usual in Qwik apps, such as: [`component$()`](/docs/(qwik)/components/overview/index.mdx#component), [`useTask$()`](/docs/(qwik)/components/tasks/index.mdx#usetask), and `<div onClick$={() => console.log('click')} />`. It serves as a marker for a lazy-load boundary. Qwik breaks your application into small chunks; these pieces are smaller than the component itself. For event handlers, hooks, etc. The `$` signals to both the [optimizer](../advanced/optimizer/index.mdx) and the developer when it's happening.
75
+
You might have noticed there are more [`$`](../advanced/dollar/index.mdx) signs than usual in Qwik apps, such as: [`component$()`](/docs/(qwik)/core/overview/index.mdx#component), [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask), and `<div onClick$={() => console.log('click')} />`. It serves as a marker for a lazy-load boundary. Qwik breaks your application into small chunks; these pieces are smaller than the component itself. For event handlers, hooks, etc. The `$` signals to both the [optimizer](../advanced/optimizer/index.mdx) and the developer when it's happening.
> - Your `joke` route default component is surrounded by an existing layout. See [Layout](/docs/layout/) for more details on what layouts are and how to work with them.
144
144
> - index.tsx, layout.tsx in routes folder, root.tsx and all entry files need **export default**. For other components you can use export const and export function
145
-
> - For more details about how to author components, see the [Component API](/docs/(qwik)/components/overview/index.mdx) section.
145
+
> - For more details about how to author components, see the [Component API](/docs/(qwik)/core/overview/index.mdx) section.
146
146
147
147
### 2. Loading Data
148
148
@@ -623,9 +623,9 @@ For more on just how much you can achieve with Qwik, check out the dedicated doc
0 commit comments