malte-wessel/react-textfit

Can not process element without height. Make sure the element is displayed and has a static height.

joshpitzalis opened this issue · 8 comments

This console error only comes up when I run unit tests.

I have tried adding a height to the component, wrapping in a span with a height, encasing a span with a height. No luck. Any suggestions for removing this warning?

pioz commented

Any update?

I have same issue. You have to explicitly set height style on the component for multi mode to work.

I have the same, it works in that it resizes the text as expected, but triggers all these warnings in the console.
Ideally the warnings should be removed from the source code, but in the mean time I have created a nasty hack.

height: "calc(100% + 1px)"

I'm getting the same thing in single mode. Littering my test run with literally hundreds of warnings. Destroys my terminal performance, fills the buffer and makes it very difficult to see legitimate problems 😢

berzi commented

Same here, even in single mode. Is this even maintained anymore?

@berzi I ended up forking it and removing the warning. It's here if you wanna switch over https://www.npmjs.com/package/@tomplum/react-textfit

Any updates? I am new to JEST and I am getting same issue