Skip to content

Commit

Permalink
chore: make deprecation message more informative by suggesting the al…
Browse files Browse the repository at this point in the history
…ternative
  • Loading branch information
limonte committed Mar 9, 2019
1 parent 82278fa commit eb660bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const defaultParams = {
scrollbarPadding: true
}

export const deprecatedParams = [
'customContainerClass'
]
export const deprecatedParams = {
customContainerClass: 'customClass'
}

const toastIncompatibleParams = [
'allowOutsideClick',
Expand Down Expand Up @@ -127,7 +127,7 @@ export const isUpdatableParameter = (paramName) => {
* @param {String} paramName
*/
export const isDeprecatedParameter = (paramName) => {
return deprecatedParams.includes(paramName)
return deprecatedParams[paramName]
}

/**
Expand All @@ -144,7 +144,7 @@ export const showWarningsForParams = (params) => {
warn(`The parameter "${param}" is incompatible with toasts`)
}
if (isDeprecatedParameter(param)) {
warnOnce(`The parameter "${param}" is deprecated and will be removed in the next major release.`)
warnOnce(`The parameter "${param}" is deprecated and will be removed in the next major release. Please use "${isDeprecatedParameter(param)}" instead.`)
}
}
}
Expand Down

0 comments on commit eb660bb

Please sign in to comment.