@bem-react/core: Recreated component after modifier changed
Open
bug
scope: core
- Dominant language
- TypeScript
- Stars
- 450
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
## Info
If we have complex modifier, and we enabled this dynamically then component will be created again, and focus will be removed from component.
### Example
**modifier:**
```ts
export const withClear = withBemMod('Component', { clearable: true }, (Component) => {
return function WithClear() {
return X} />
}
})
```
**usage:**
```ts
function App() {
const [clearable, setClearable] = React.useState(false)
React.useEffect(() => {
setTimeout(() => setClearable(true), 1000)
}, [])
return (
)
}
```
### Expected behavior
Component should update without focus side-effects.
Contributor guide
Assessment
This issue has not been assessed yet.