We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello ! Is it possible to pass width/height as string to make div fix to parent and not with a static width/height ?
The text was updated successfully, but these errors were encountered:
This is how I solved this:
import { useMeasure } from "react-use"; ... const [ready, setReady] = useState(false); const [ref, { width, height }] = useMeasure(); ... useEffect(()=>{ if(width && height) setReady(true); },[width, height]);
Then use the ref in the DIV
<div className="parentdiv" ref={ref}> {ready && <WordCloud data={keywords} width={width} height={height} font="sans-serif" rotate={() => (Math.random() > 0.3 ? 0 : 90)} padding={5} fill={() => (Math.random() > 0.5 ? "#000" : "#fff")} fontWeight="bold" /> } </div>
Sorry, something went wrong.
No branches or pull requests
Hello !
Is it possible to pass width/height as string to make div fix to parent and not with a static width/height ?
The text was updated successfully, but these errors were encountered: