Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkContainer on Pager.Item unknown prop active #185

Open
dmason30 opened this issue Oct 7, 2016 · 8 comments
Open

LinkContainer on Pager.Item unknown prop active #185

dmason30 opened this issue Oct 7, 2016 · 8 comments

Comments

@dmason30
Copy link

dmason30 commented Oct 7, 2016

Take this example for bootstrap pager:

        <Pager>
            {previous &&
            <LinkContainer to={{ pathname: 'example/list', query: { page: (current_page-1) }}} >
                <Pager.Item previous href="#">&larr; Previous Page</Pager.Item>
            </LinkContainer>
            }

            {next &&
            <LinkContainer to={{ pathname: 'example/list', query: { page: (current_page+1) }}} >
                <Pager.Item next href="#">Next Page &rarr;</Pager.Item>
            </LinkContainer>
            }
        </Pager>

I get the below warning:

Warning: Unknown prop `active` on <a> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
    in a (created by SafeAnchor)
    in SafeAnchor (created by PagerItem)
    in li (created by PagerItem)
    in PagerItem (created by OrdersListComponent)
    in LinkContainer (created by OrdersListComponent)
    in ul (created by Pager)
    in Pager (created by OrdersListComponent)
@godmar
Copy link

godmar commented Oct 26, 2016

I believe this is an issue with react-bootstrap, not react-router-bootstrap. I filed an issue.

@taion
Copy link
Member

taion commented Oct 26, 2016

We should have an activePropName prop on <LinkContainer>. If this is unset, then we can avoid passing down an active prop.

appleparan added a commit to appleparan/winterschool2017 that referenced this issue Nov 6, 2016
- I can't fix another one because react-bootstrap doesn't have Navbar.Button react-bootstrap/react-router-bootstrap#185
change menuItem name : Organizer -> Program
@TrejGun
Copy link

TrejGun commented Nov 29, 2016

Hi taion

I see the same problem for

<LinkContainer>
    <Thumbnail/>
</LinkContainer>

@RamonBeast
Copy link

Same here. Is there a possible workaround? For now my links acquire the active class only if the page is reloaded, if the user switches from one page to another, the navbar links do not change their active state.

@godmar
Copy link

godmar commented Dec 5, 2016

See my workaround

@baebb
Copy link

baebb commented Feb 27, 2017

Not getting the error as mentioned but the active item is not changing for my

component unless I refresh the page

@RamonBeast
Copy link

Same here, did you try @godmar workaround?

@ventskus-roman
Copy link

After upgrade of react to 15.6 version I get the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants