Andarist / Andarist/react-textarea-autosize

fix: not working with styled-component

Aperta
#399 1 commento 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
2.4k
Fork
247
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi!

### Condition

`TextareaAutosize` does not work when

- styled-components wraps `TextareaAutosize`

AND

- a state is used for value

### Symptom

I can input a single letter, but not more.

### Minimal Reproduction

```tsx
'use client'

import TextareaAutosize from 'react-textarea-autosize'
import styled from 'styled-components'
import { useState } from 'react'

export default function Temp() {
const [message, setMessage] = useState('')
const Wrapper = styled.div``

// When I remove either Wrapper or state, it works.
return (

setMessage(e.target.value)}
/>

)
}
```

Is this a bug, or is there a solution?

Thanks,

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.