You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am using NextJS and updated my component accordingly to fix the window problem, but somehow I am stuck now with the error message "e.find is not a function". This is my code
importmatchesfrom"/db/matches.js";import{useState,useEffect}from"react";constSingleEliminationBracket=dynamic(()=>import("@g-loot/react-tournament-brackets").then((mod)=>mod.SingleEliminationBracket),{ssr: false});constMatch=dynamic(()=>import("@g-loot/react-tournament-brackets").then((mod)=>mod.Match),{ssr: false});constSVGViewer=dynamic(()=>import("@g-loot/react-tournament-brackets").then((mod)=>mod.SVGViewer),{ssr: false});constTournamentWrapper=()=>{constgetWindowSize=()=>{if(typeofwindow!=="undefined"){return{width: window.innerWidth||document.documentElement.clientWidth,height: window.innerHeight||document.documentElement.clientHeight,};}return{width: 0,height: 0};};const[windowSize,setWindowSize]=useState(getWindowSize());useEffect(()=>{consthandleResize=()=>{setWindowSize(getWindowSize());};window.addEventListener("resize",handleResize);return()=>{window.removeEventListener("resize",handleResize);};},[]);constfinalWidth=Math.max(windowSize.width-50,500);constfinalHeight=Math.max(windowSize.height-100,500);return(<divclassName="bg-black"><h1>Tournament Bracket</h1><SingleEliminationBracketmatches={matches}// Remove the extra curly bracesmatchComponent={Match}svgWrapper={({ children, ...props})=>(<SVGViewerwidth={finalWidth}height={finalHeight}{...props}>{children}</SVGViewer>)}/></div>);};exportdefaultTournamentWrapper;
Hi, I am using NextJS and updated my component accordingly to fix the window problem, but somehow I am stuck now with the error message "e.find is not a function". This is my code
and I am using the matches.js from here: https://sleepy-kare-d8538d.netlify.app/?path=/story/components-bracket--bracket
It seems it has a problem with the matches array, but I can´t figure out, what the problem actually is.
The text was updated successfully, but these errors were encountered: