I built a HOC to use on protected routes in my app. It takes in the component that should be rendered at the route, checks if the user is authenticated, and then renders th
By calling RequireAuth(Component)
in render, you are decorating Component
with your HOC in every render call, making that each render returns a new Component each render.
You should decorate Group
, CreateGroup
and GroupsMenu
with RequireAuth
, before exporting them. Just as you would with react-redux
's connect
.