Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/docs/pages/docs/components/anatomy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const MyCmp = component$(async (props: MyCmpProps) => {
<span>Hello, {props.name} {state.count}</span>
<div>Times: {state.count}</div>
<button onClick$={() => {
// this will update the local state and cause a re-render
// reactivity is at qwik's core
// This will update the local state and cause a re-render.
// Reactivity is at qwik's core!
state.count++;
}}
>
Expand All @@ -39,7 +39,7 @@ export const MyCmp = component$(async (props: MyCmpProps) => {

## Props

Props are used to pass data into the a component. Props are declared as named arguments of the component.
Props are used to pass data into the component. Props are declared as named arguments of the component.

In this example a component `Item` declares optional `name`, `quantity`, `description`, and `price`.

Expand Down Expand Up @@ -122,7 +122,7 @@ Will result in:

### `useHostElement()`

Since the host element is implicitally created by `component$`, it is not possible to access it directly. Instead, you can use `useHostElement()` to get the host element.
Since the host element is implicitly created by `component$`, it is not possible to access it directly. Instead, you can use `useHostElement()` to get the host element.

Qwik uses host elements in various ways. For example when using `useHostElement()` function which retrieves it. It is also used to attach props to the components for serialization.

Expand Down Expand Up @@ -157,7 +157,7 @@ In both above cases the rendered HTML would be:
<div q:host></div>
```

Because the host element is an actual element, there may be a desire to place HTML classes, styles, or attributes.
Because the host element is an actual element, there may be a desire to place HTML classes, styles, or attributes on the host element.

What if you wanted to add a `name` attribute to the host element? The issue is that the `name` is already used by the component props. For this reason, we use `host:` prefix to refer to the host element's attributes.

Expand All @@ -177,7 +177,7 @@ would render as:
<div q:host name="abc" id="greeter" onClickQrl="..."></div>
```

Using an `host:` prefix allows the developer to control the component's host element attributes independently from the component's props.
Using a `host:` prefix allows the developer to control the component's host element attributes independently from the component's props.

One can use the same approach for `class` and `styles`.

Expand Down
6 changes: 3 additions & 3 deletions packages/docs/pages/docs/components/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ title: Hooks

## useStore()

Creates a object that Qwik can track across serializations.
Creates an object that Qwik can track across serializations.

Use `useStore` to create state for your application. The return object is a proxy which has a unique ID. The ID of the object is used in the `QRL`s to refer to the store.
Use `useStore` to create state for your application. The returned object is a proxy which has a unique ID that is used in `QRL`s to refer to the store.

### Example

Expand Down Expand Up @@ -59,7 +59,7 @@ function useCounter(step: number) {

## useRef()

It's a very thin wrapper around `useStore()` including the proper type signature to be passed to the `ref` property in JSX.
A very thin wrapper around `useStore()` including the proper type signature to be passed to the `ref` property in JSX.

```tsx
export function useRef<T = Element>(current?: T): Ref<T> {
Expand Down