Skip to content

Commit

Permalink
Merge pull request remix-run#82 from robcolburn/deprecation-message
Browse files Browse the repository at this point in the history
Clarify createLocation deprecation message.
  • Loading branch information
mjackson committed Oct 6, 2015
2 parents 4117a77 + 2b7ad71 commit eb05768
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/Location.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ Support for query string parsing is provided using the [`useQueries` module](Que
You may occasionally need to create a `location` object, either for testing or when using `history` in a stateless environment (like a server). `history` objects have a `createLocation` method for this purpose.

```js
import { createHistory } from 'history'
let history = createHistory()
let location = history.createLocation('/a/path?a=query', { the: 'state' })
```
2 changes: 1 addition & 1 deletion modules/createLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ function createLocation(path='/', state=null, action=POP, key=null) {

export default deprecate(
createLocation,
'createLocation is deprecated; use history.createLocation instead'
'Calling createLocation statically is deprecated; instead call the history.createLocation method - see docs/Location.md'
)
2 changes: 1 addition & 1 deletion modules/deprecate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import warning from 'warning'

function deprecate(fn, message) {
return function () {
warning(false, message)
warning(false, '[history] ' + message)
return fn.apply(this, arguments)
}
}
Expand Down

0 comments on commit eb05768

Please sign in to comment.