# use-force-render

{% hint style="danger" %}
Since the version of atomico\@1.14.\* there is the [**useUpdate**](https://atomico.gitbook.io/doc/api/hooks/useupdate) hook, with the same functionality but in the core of Atomico.
{% endhint %}

### Modulo

```javascript
import { useForceRender } from "@atomico/hooks/use-force-render";
```

### Syntax

```javascript
const forceRender = useForceRender();
```

Where:

1. `forceRender`: `Callback` to force rendering of the webcomponent.

### Example

Sometimes the rendering of the webcomponent does not depend on a state or property of this, to reflect these changes you can use `useForceRender` to regenerate the DOM, example:

```jsx
function component() {
  const ref = useRef();
  const forceRender = useForceRender();

  return (
    <host>
      {ref.current.anyProp}
      <my-component ref={ref} onclick={forceRender}></my-component>
    </host>
  );
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atomico.gitbook.io/doc/packages/atomico-hooks/use-force-render.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
