I am using Context API to pass items from one component to another. I am destructuring items as one would do:
const { smallPrice, bigPrice } = useContext(Context)
I wondered if it would be possible to destructure them with interpolated strings, so that I can use the props.id from the component.
const { `smallPrice${props.id}`, `bigPrice${props.id}` } = useContext(Context)
This won't work however. Are there any alternatives to destructure things coming from context with interpolated strings?