DOPΣ - what to add here in plated hole, i updat...

what to add here in plated hole, i updated circuit-json
No description
21 Replies
Seve
Seve3w ago
it should be holeOffsetX and holeOffsetY idk why there's a pcbHoleOffsetX etc. that's just wrong maybe there was a bad PR merged at some point that was later fixed
DOPΣ
DOPΣOP3w ago
should i go with this?
No description
Seve
Seve3w ago
ideally no, because that would break the code that handles hole offset do you have an old version of props? try bun i or even update to the latest version of props
DOPΣ
DOPΣOP3w ago
updated props, still no prop like that
No description
Seve
Seve3w ago
CC @Abse what is going on here CC @Rishabh idk who knows about hole offsets
Seve
Seve3w ago
GitHub
props/lib/components/platedhole.ts at 6f1ff28e992b0624ce552d6961317...
Prop definitions for tscircuit components. Contribute to tscircuit/props development by creating an account on GitHub.
Seve
Seve3w ago
maybe you need to cast the props? (props as PlatedHoleProps) or something?
Abse
Abse3w ago
what is going on ? I changed the props from pcbHoleOffset to holeOffset there was a pcbHoleOffset before
DOPΣ
DOPΣOP3w ago
Yup, I changed in one place But on another place there is nothing like props.offsrt anything That 0,0 place
Abse
Abse3w ago
where
DOPΣ
DOPΣOP3w ago
See this pr diff
Abse
Abse3w ago
and there is no prop.holeOffsetX ? props looks good to me let me double check
Abse
Abse3w ago
Abse
Abse3w ago
wait even if I updated props in core I still can't get the props.HoleOffset ?
Abse
Abse3w ago
same issue
No description
Seve
Seve3w ago
it seems like props might be losing it's type
Abse
Abse3w ago
so how can we fix this ?
Seve
Seve3w ago
it seems like the type narrowing for props is causing the issue so it's a regular like "don't forget to narrow"
Abse
Abse3w ago
so what should we do
Seve
Seve3w ago
there are a couple ways to solve type narrowing, but it requires more context. For some reason, typescript doesn't know the type of props there might also be a mistake in the props definition

Did you find this page helpful?