question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Selected ListItem styles not working with SSR

See original GitHub issue

With client-side rendering the first item gets the mdc-list-item--selected class and aria-selected="true" as expected. However with server-side rendering (tested with next.js) this is not the case (and all the items look the same). I believe it’s an issue with this library rather than material-components-web?

<List
  singleSelection
  selectedIndex={0}
>
  <ListItem>
    <ListItemText primaryText='One' />
  </ListItem>
  <ListItem>
    <ListItemText primaryText='Two' />
  </ListItem>
  <ListItem>
    <ListItemText primaryText='Three' />
  </ListItem>
</List>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
moog16commented, Dec 11, 2018

@dan-kwiat thanks for figuring that out! I spent quite a bit of time and couldn’t figure it out. I’ll try testing this out with your SSR demo.

0reactions
moog16commented, Dec 11, 2018

Merged #509…thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styled-components - CSS class not applied with SSR
I have an issue when I navigate to a page using links, my CSS classes are not all applied. ... Whereas when I...
Read more >
react-select-search
Start using react-select-search in your project by running `npm i react-select-search`. There are 17 other projects in the npm registry ...
Read more >
React List component - Material UI
Lists are continuous, vertical indexes of text or images.
Read more >
Implementing SSR in Next.js: Dynamic routing and ...
Implementing server-side rendering on specific pages could be a challenging task, however. Next.js attempts to solve this problem by allowing ...
Read more >
Server-Side Rendering (SSR)
Browser-specific code can only be used inside certain lifecycle hooks; ... The HTML is completely static on the client since we are not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found