Introducing CrudHunt:Open-source Full-stack CRUDs for Next.js by KeenThemes
Browse CrudHunt

RTK Query in react


Hi,

I am implementing a simple Redux ToolKit Query in the Topbar component, where the user info is fetched with a generated useQuery hook. Once the data is loaded the component is rendered and the data is passed down as props to the HeaderUserMenu component. The issue we are facing is that with this implementation, once the login happens and the dashboard is loaded with the Topbar, the menu dropdown is not opening on click. If we refresh the paged as logged in where the dashboard loads with the topbar directly, then the dropdown works but not after simple route change. What are we missing?

P.s: if simple useSelector hooks are used with separate store slices, it works, but we are migrating to RTK Query and no separate store is used to hold the data other than the cache.

Thanks for your suggestions in advance!


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (0)