const setCurPage: React.Dispatch<React.SetStateAction<number>>
'setCurPage' was declared, but its value was never read. ts(6133)
'setCurPage' is assigned a value but never used.eslint@typescript-eslint/no-unused-vars
This error is caused by eslint, so you need to modify the configuration of eslint: you can see the official document prompt no-unused-vars | typescript-eslint
Just simply add two configurations:
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"@typescript-eslint/no-explicit-any": ["off"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off"
},
}
If the configuration does not take effect immediately, you can restart vscode: no error will be reported, only a prompt