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
{{ message }}
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
we are thinking about using your package in one of our projects and we usually really like to use sass with css-modules on every component for styling.
We tried to implement it the way, we always do, but there seems to be a problem with the serverside rendering part.
We import the styles with
import * as styles from './STYLEFILE.scss
Then we want to access the different style Classnames like
<div className={styles.ClassName} />
The problem now is, that we end up getting undefined as the className, but if we change something and use hotreload (so it rerenders on the client side only), it works and shows the className correctly.
Also console.logging the className gives the correct result.
Here is our example DemoComponent:
import * as React from "react";
import { GetHackerNewsTopStoriesQuery } from "@/graphql";
import * as styles from './DemoListing.scss';
interface IDemoListingPropType {
data?: GetHackerNewsTopStoriesQuery,
}
export class DemoListing extends React.PureComponent<IDemoListingPropType> {
public render() {
const { data } = this.props;
console.log('Check it here: ', styles.List);
return (
<ul className={styles.List}>
{data!.hn!.topStories!.map(story => (
<li key={story!.id!}>
<a href={story!.url!} target="_blank">
{story!.title}
</a>
</li>
))}
</ul>
);
}
}
Hi,
we are thinking about using your package in one of our projects and we usually really like to use sass with css-modules on every component for styling.
We tried to implement it the way, we always do, but there seems to be a problem with the serverside rendering part.
We import the styles with
Then we want to access the different style Classnames like
The problem now is, that we end up getting
undefined
as the className, but if we change something and use hotreload (so it rerenders on the client side only), it works and shows the className correctly.Also console.logging the className gives the correct result.
Here is our example DemoComponent:
And here is our DemoListing.scss file:
The text was updated successfully, but these errors were encountered: