When I try to import a variable from the same folder, why am I getting an error message saying it is defined but not used? I am sure that I am using it. Your input would be greatly appreciated!
error
'componentName' is defined but never used.
dynamic-component-data-mapping.js
import { componentName } from './strapi-helpers.js'
function mapData(response, componentName) {
const componentList = response.reduce(function(matchedComponents, component) {
if (component.__component === componentName) {
component.__component = componentName(component.__component)
matchedComponents.push(component)
}
return matchedComponents
}, [])
return componentList
}
export {
mapData
}
strapi-helpers.js
function componentName(currentName) {
if (currentName && currentName.indexOf('.')) {
return currentName.replace('.', '-')
}
}
export {
componentName
}