pixelass / react-stickyroll

A react implementation of stickyroll (original)

Home Page:https://react-stickyroll.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pagers component does not take the theme provided

robgev opened this issue · comments

Describe the bug
Pagers component is ignoring the theme provided as a prop.

To Reproduce
Steps to reproduce the behavior:

  1. Render
  2. Give it any theme either via a provider or directly by theme={indigo}
  3. The Pagers still gets the default light theme
  4. See error

Codesandbox

Here's a codesandbox that shows this issue: https://codesandbox.io/s/ecstatic-hopper-i1n26

Expected behavior
The Pagers component should get and apply the theme

Desktop (please complete the following information):

  • OS: Mac OS Mojave
  • Browser Chrome
  • Version 78

Additional context
The problem comes from the fact that in pagers.tsx the Pagers component passes all the props except the theme to PagerBase.

The actual issue here is, that styled-components are listed in dependencies with version pinning. It works when you use styled-components@4.3.2 (see https://codesandbox.io/s/condescending-ives-4p254)

I have to update the dependency logic (which is 100% wrong) since this will fix the resulting issue described here.

But it should also work in the case when I provide a theme as a prop, without using styled-components. The library is independent of styled-components.

No, actually some rely on styled-components. Basically everything in the components folder is built on styled-components.

I see what you mean though. While Inner and Content allow passing the theme as a prop, it won't work for Pagers.
Since this was never intended to be used this way I will label this as enhancement (You can wrap Pagers in ThemeProvider as designed).

I will look into it and consider your changes. Thank you for the discovery on this issue.

commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.