Here's my PageLink component,
export const PageLink: React.FC<IProps> = ({ id, question, searchBy }) => {
return (
<Link to={{pathname: `results/${id}`, search: `?sortBy=${searchBy}`}} className={styles.PageLink}>
{question}
</Link>
);
};
None of the styles that I've written under PageLink is applied to this component. (BTW, I'm using css modules for this).
Based on other answers in SO, I replaced Link with NavLink and it works fine.
So, I have 2 questions,
Based on this issue page people are telling that it's not a bug.
NavLink instead of Link (for my use case)I just restarted my server and it just works with Link as well. I suspect that there's something funny going on with ts compiler. What's even strange is, I noticed many people asking the same question in different forums.