Closed frankcollins3 closed 11 months ago
still can't get it. chatGPT suggested this. added [0] index and didn't work either.
const selectedIconJQ = $(#${styles.selectedIcon}
)
[11:13am]
the image element had a class before that it shared alongside the {confirm, reject} buttons to select icon. 👍 this solution: give img element a unique class, & string ID to which the jq expression that adds class can target.
<img id="iconID" className={styles.icon} src={img || NON_GOOGLE_IMG_URL}/> [11:20am]
attempting to do: translate this: const confirmationJQ = $('#confirmation')[0] with an
<img id={styles.selectedIcon}/>
error: JQ && SASS fussing
proposed approach: 0: useEffect -> document.querySelector(${styles.selectedIcon} -> useRef().current to store the reference to element
1: string interpolation wasn't working