Skip to content

Commit

Permalink
Set dynamic values for component on mount
Browse files Browse the repository at this point in the history
- Fixes bug when a component is remounted but there is no switch change
  and the dynamic values were not set
  • Loading branch information
jdlehman committed Apr 1, 2016
1 parent 0d6cd44 commit 19a58c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/switcheroo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ export default class Switcher extends Component {

var currPath = currentPath(props.location);
var switchElement = getSwitch(currPath, props);
var dynamicValues = getDynamicSegments(currPath, props.basePath, switchElement);
this.state = {
visibleSwitch: switchElement,
dynamicValues: {}
dynamicValues
};
}

Expand Down

0 comments on commit 19a58c2

Please sign in to comment.