`theme` attribute does not update dynamically

Open
#322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with the theme prop handling for the Button, TextField, and ComboBox components, then reproduce the state change shown in the example. Done means changing the state updates the theme attribute and the component's visual theme after the initial render.

Written by the indexing model from the issue text.

Description

bug Impact: Low Severity: Minor

The theme attribute on Vaadin React components (e.g., Button, TextField, ComboBox) does not update dynamically when the theme prop is changed after the initial render.

Steps to Reproduce:

  • Render a Vaadin React component (e.g., Button) with a theme prop bound to a state variable.
  • Update the state variable that controls the theme prop.
  • Observe that the component's visual theme does not change, the attribute does not update.

Example:

export default function Repro() {
  const [theme, setTheme] = useState('');
  return (
    <>
      <Button theme={theme}>Foo</Button>
      <TextField theme={theme} />
      <ComboBox theme={theme}></ComboBox>
      <input type="checkbox" onChange={(e) => setTheme(e.target.checked ? 'small' : '')} />
    </>
  );
}
Dominant language
TypeScript
Stars
18
Forks
4
Avg merge
52m
Merged PRs (30d)
7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vaadin/react-components

All issues in vaadin/react-components

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.