selectCallback sets variant equal to null on all my option selections besides the initial call. On the initial call, it logs the variant with the first color and size.
const productJson = JSON.parse($(`#${id}`).attr('data-product'));
new Shopify.OptionSelectors(id, {
product: productJson,
onVariantSelected: selectCallback,
});
const selectCallback = (variant, select, options) => {
console.log(variant) // `null`
}
I'm expecting to get variant object which matches my size/color selections.