I am using both d3 and d3-tip along with their @types,
"@types/d3": "^4.4.0",
"@types/d3-tip": "^3.5.2",
"d3": "^4.4.0",
"d3-tip": "^0.7.1",
I have below import statement,
import * as d3 from 'd3';
When trying to compile below typescript code, got below error,
var tip = d3.tip()
.attr('class', 'd3-tip')
.offset([-10, 0])
.html(function (d) {
return "<strong>Frequency:</strong> <span style='color:red'></span>";
})
Error,
error TS2339: Property 'tip' does not exist on type 'typeof "C:/bugFix/WebPackPOC/src/WebPackApp/node_modules/@types/d3/index"'.
You are importing d3 but not d3-tip, which is another package.
import 'd3-tip';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With