Is there any way to get an estimate for text width without rendering the actual elements? Something like canvas TextMetrics?
Case: I need to estimate element heights for ReactList. To do that I'd need to know roughly how much space the text elements will need (or how many lines will they span).
eg.
render(){
return <div><SomeComponentWithKnownDims/><p>{this.props.someText}</p></div>;
}
If I knew how wide someText would be rendered into one line and how long the line would be, I could easily come up with a decent estimate for the components height.
EDIT: Note that this is quite performance critical and DOM should not be touched