Still a Can of Worms, 2020
After having spent some months focused completely on computer game development, I have decided to refresh my frontend web developer skills, and gave the React.js framework and its companions a closer look.
As a practice assignment I wanted to recreate a web based data editor application (that I wrote for one of my game prototypes) as a Node.js backend and a React.js frontend. I also wanted to use MaterialUI, a framework for React that implements the visuals and UX defined by Google’s Material design language.
One of the first components I had to write was a simple data grid with pagination. The task is quite straightforward, and MaterialUI even provides a TablePagination
component that can handle when the user changes how many items they wish to see at once.
After setting up the handler function for this I was surprised to see a warning appearing in the browser console, stating: “findDOMNode is deprecated in StrictMode”. The People of the Internet have simply recommended removing the Strict mode tag completely, because “the MaterialUI team is not keeping up with the React devs”. How nice.
And the adventure continues, as the pagination itself seems to be broken. During testing with my static, mocked recordset, I kept getting a warning “Failed prop type: Material-UI: The page prop of a TablePagination is out of range (0 to 0, but page is 1).” There are open issues on GitHub about this, since 2019, and the recommendation is to downgrade the library. Again, how nice.
So what’s the best next step in a situation like this? Do I get rid of the React.StrictMode
component and hope the warnings I suppress this way can’t hurt me, or should I look into the bugs in MaterialUI itself? Having this pagination thingy is a very small part of the application I’m working on, and choosing MaterialUI (and even React itself) only makes sense as long as it makes my life easier and my progress faster and more efficient. Do I circumvent these issues in some way, trying to salvage as much functionality from MaterialUI as possible? Which can of worms should I open first?