We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dde5f42 commit f3dcdd7Copy full SHA for f3dcdd7
2 files changed
modules/helpers/Path.js
@@ -85,7 +85,7 @@ var Path = {
85
var paramName = getParamName(pathSegment);
86
87
invariant(
88
- params[paramName],
+ params[paramName] != null,
89
'Missing "' + paramName + '" parameter for path "' + pattern + '"'
90
);
91
specs/Path.spec.js
@@ -127,6 +127,10 @@ describe('Path.injectParams', function () {
127
it('returns the correct path', function () {
128
expect(Path.injectParams(pattern, { id: 'abc' })).toEqual('comments/abc/edit');
129
});
130
+
131
+ it('returns the correct path when the value is 0', function () {
132
+ expect(Path.injectParams(pattern, { id: 0 })).toEqual('comments/0/edit');
133
+ });
134
135
136
describe('and some params have special URL encoding', function () {
0 commit comments