Skip to content

fix(TetherContent): rerender when other props change#128

Merged
eddywashere merged 1 commit intoreactstrap:masterfrom
TheSharpieOne:bugfix/iss-125
Sep 8, 2016
Merged

fix(TetherContent): rerender when other props change#128
eddywashere merged 1 commit intoreactstrap:masterfrom
TheSharpieOne:bugfix/iss-125

Conversation

@TheSharpieOne
Copy link
Copy Markdown
Member

Fix #125
Let the TetherContent re-render when any props change while it is
showing. This allows the children to update dynamically without
needing to hide and show the content to force the update.

This also includes tests, but no additional docs as this is not a feature, but something that should just work this way.
If you would like me to add to the docs to document this, let me know and I will adjust this PR.

Fix reactstrap#125
Let the TetherContent rerender when any props change while it is
showing. This allows the children to update dynamically without
needing to hide and show the content to force the update.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 1b2ab7e on TheSharpieOne:bugfix/iss-125 into 8fd0761 on reactstrap:master.

const instance = wrapper.instance();

expect(TetherContent.prototype.componentWillUnmount.calls.count()).toBe(0);
expect(TetherContent.prototype.componentDidMount.calls.count()).toBe(1);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I threw this in here, the test didn't make any sense saying show should be called on unmount. Seemed like a copy paste from the one above it. Now this tests to make sure the show is called when the component did mount.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@eddywashere
Copy link
Copy Markdown
Member

Thanks @TheSharpieOne

@eddywashere eddywashere merged commit 25600d4 into reactstrap:master Sep 8, 2016
@TheSharpieOne TheSharpieOne deleted the bugfix/iss-125 branch September 8, 2016 04:31
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

Successfully merging this pull request may close these issues.

3 participants