# `ZebbraCredo.Check.AssignInRender`
[🔗](https://github.com/zebbra/zebbra_credo/blob/v1.0.0/lib/zebbra_credo/check/assign_in_render.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `high` and works with any version of Elixir.

## Explanation

An assign made in a LiveView's or LiveComponent's `render/1` counts as
changed on every render, so every patch re-renders whatever reads it: a
whole table, if its rows do. Compute the value where its inputs change
(`mount`, `handle_params`, `handle_event`, `update`) or read it in the
template:

    hidden_columns={Map.get(@collection_hidden_columns, @collection_id, [])}

Function components assign as usual; this check reads only `render/1`.

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:app`

  The app's root module; its web module is where `use <Web>, :live_view` is recognised.

*This parameter defaults to* `nil`.

### `:web`

  The app's web namespace when it is not `<app>Web`.

*This parameter defaults to* `nil`.

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
