react-router-bootstrap icon indicating copy to clipboard operation
react-router-bootstrap copied to clipboard

Inline styles on buttons are lost

Open davidworkman9 opened this issue 5 years ago • 2 comments

Style attributes attached to buttons are lost when inside a LinkContainer

<LinkContainer to="/place">
    <Button
        className="btn btn-success"
        style={{ position: 'absolute', top: 0 }}
    >
        Go To Place
    </Button>
</LinkContainer>

Results in:

<h3 class="text-center">Projects</h3>
<a href="/place" class="btn btn-success btn btn-default">Go To Place</a>

davidworkman9 avatar Aug 15 '18 14:08 davidworkman9

I have the same issue, but with Cards. The problem is inline style is necessary for Cards, since the width is set with: style={{width: '16rem}} After nesting the Card in a LinkContainer the inline style is lost.

varrtto avatar Feb 05 '19 17:02 varrtto

It does look like a bug but as a workaround you can specify the style that needs to be applied to your child element in LinkContainer - it's populated down to your component that's being wrapped. Thanks for the report.

v12 avatar Apr 04 '19 17:04 v12