Skip to content

Commit

Permalink
Correct links to documentation in error messages (#1314)
Browse files Browse the repository at this point in the history
* fix: correct doc links in error messages

* fix: update documentation links in tsx files
  • Loading branch information
darthtrevino committed Apr 2, 2019
1 parent 5b58d29 commit ae7ffe2
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions packages/react-dnd/src/DragLayer.tsx
Expand Up @@ -23,13 +23,13 @@ export default function DragLayer<RequiredProps, CollectedProps = {}>(
invariant(
typeof collect === 'function',
'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',
'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html',
'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer',
collect,
)
invariant(
isPlainObject(options),
'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. ' +
'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html',
'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer',
options,
)

Expand Down Expand Up @@ -116,7 +116,7 @@ export default function DragLayer<RequiredProps, CollectedProps = {}>(
typeof dragDropManager === 'object',
'Could not find the drag and drop manager in the context of %s. ' +
'Make sure to wrap the top-level component of your app with DragDropContext. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context',
'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context',
displayName,
displayName,
)
Expand Down
8 changes: 4 additions & 4 deletions packages/react-dnd/src/DragSource.ts
Expand Up @@ -47,7 +47,7 @@ export default function DragSource<
'Expected "type" provided as the first argument to DragSource to be ' +
'a string, or a function that returns a string given the current props. ' +
'Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
type,
)
getType = () => type
Expand All @@ -56,7 +56,7 @@ export default function DragSource<
isPlainObject(spec),
'Expected "spec" provided as the second argument to DragSource to be ' +
'a plain object. Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
spec,
)
const createSource = createSourceFactory(spec)
Expand All @@ -65,15 +65,15 @@ export default function DragSource<
'Expected "collect" provided as the third argument to DragSource to be ' +
'a function that returns a plain object of props to inject. ' +
'Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
collect,
)
invariant(
isPlainObject(options),
'Expected "options" provided as the fourth argument to DragSource to be ' +
'a plain object when specified. ' +
'Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
collect,
)

Expand Down
4 changes: 2 additions & 2 deletions packages/react-dnd/src/DragSourceMonitorImpl.ts
Expand Up @@ -33,7 +33,7 @@ export default class DragSourceMonitorImpl implements DragSourceMonitor {
invariant(
!isCallingCanDrag,
'You may not call monitor.canDrag() inside your canDrag() implementation. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor',
)

try {
Expand All @@ -48,7 +48,7 @@ export default class DragSourceMonitorImpl implements DragSourceMonitor {
invariant(
!isCallingIsDragging,
'You may not call monitor.isDragging() inside your isDragging() implementation. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor',
)

try {
Expand Down
8 changes: 4 additions & 4 deletions packages/react-dnd/src/DropTarget.ts
Expand Up @@ -41,7 +41,7 @@ export default function DropTarget<RequiredProps, CollectedProps = {}>(
'Expected "type" provided as the first argument to DropTarget to be ' +
'a string, an array of strings, or a function that returns either given ' +
'the current props. Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
type,
)
getType = () => type
Expand All @@ -50,7 +50,7 @@ export default function DropTarget<RequiredProps, CollectedProps = {}>(
isPlainObject(spec),
'Expected "spec" provided as the second argument to DropTarget to be ' +
'a plain object. Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
spec,
)
const createTarget = createTargetFactory(spec)
Expand All @@ -59,15 +59,15 @@ export default function DropTarget<RequiredProps, CollectedProps = {}>(
'Expected "collect" provided as the third argument to DropTarget to be ' +
'a function that returns a plain object of props to inject. ' +
'Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
collect,
)
invariant(
isPlainObject(options),
'Expected "options" provided as the fourth argument to DropTarget to be ' +
'a plain object when specified. ' +
'Instead, received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
collect,
)

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dnd/src/DropTargetMonitorImpl.ts
Expand Up @@ -38,7 +38,7 @@ export default class DropTargetMonitorImpl implements DropTargetMonitor {
invariant(
!isCallingCanDrop,
'You may not call monitor.canDrop() inside your canDrop() implementation. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor',
)

try {
Expand Down
8 changes: 4 additions & 4 deletions packages/react-dnd/src/createSourceFactory.ts
Expand Up @@ -61,7 +61,7 @@ class SourceImpl<Props> implements Source {
isPlainObject(item),
'beginDrag() must return a plain object that represents the dragged item. ' +
'Instead received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
item,
)
}
Expand Down Expand Up @@ -89,15 +89,15 @@ export default function createSourceFactory<Props, DragObject = {}>(
'Expected the drag source specification to only have ' +
'some of the following keys: %s. ' +
'Instead received a specification with an unexpected "%s" key. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
ALLOWED_SPEC_METHODS.join(', '),
key,
)
invariant(
typeof (spec as any)[key] === 'function',
'Expected %s in the drag source specification to be a function. ' +
'Instead received a specification with %s: %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
key,
key,
(spec as any)[key],
Expand All @@ -108,7 +108,7 @@ export default function createSourceFactory<Props, DragObject = {}>(
typeof (spec as any)[key] === 'function',
'Expected %s in the drag source specification to be a function. ' +
'Instead received a specification with %s: %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',
key,
key,
(spec as any)[key],
Expand Down
6 changes: 3 additions & 3 deletions packages/react-dnd/src/createTargetFactory.ts
Expand Up @@ -63,7 +63,7 @@ class TargetImpl<Props> implements Target {
typeof dropResult === 'undefined' || isPlainObject(dropResult),
'drop() must either return undefined, or an object that represents the drop result. ' +
'Instead received %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
dropResult,
)
}
Expand All @@ -80,15 +80,15 @@ export default function createTargetFactory<Props>(
'Expected the drop target specification to only have ' +
'some of the following keys: %s. ' +
'Instead received a specification with an unexpected "%s" key. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
ALLOWED_SPEC_METHODS.join(', '),
key,
)
invariant(
typeof (spec as any)[key] === 'function',
'Expected %s in the drop target specification to be a function. ' +
'Instead received a specification with %s: %s. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',
'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',
key,
key,
(spec as any)[key],
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dnd/src/decorateHandler.tsx
Expand Up @@ -227,7 +227,7 @@ export default function decorateHandler<Props, CollectedProps, ItemIdType>({
dragDropManager !== undefined,
'Could not find the drag and drop manager in the context of %s. ' +
'Make sure to wrap the top-level component of your app with DragDropContext. ' +
'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context',
'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context',
displayName,
displayName,
)
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dnd/src/utils/checkDecoratorArguments.ts
Expand Up @@ -12,7 +12,7 @@ export default function checkDecoratorArguments(
console.error(
'You seem to be applying the arguments in the wrong order. ' +
`It should be ${functionName}(${signature})(Component), not the other way around. ` +
'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order',
'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#you-seem-to-be-applying-the-arguments-in-the-wrong-order',
)
return
}
Expand Down

0 comments on commit ae7ffe2

Please sign in to comment.