Pure react-js plot.ly multiple dropdown logic

(copied from stackoverflow : javascript - Is there a way for pure React App (no dash) using plotly.js to make a graph with two dropdowns such that both influence the graph displayed? - Stack Overflow)

I am currently making a React App (without dash) with plotly.js

I want to make 2 dropdown menus that filter the data in a different way, and can be combined to filter the data further.

For example, suppose my data is

A1 : [1,2,3]
A2 : [2,3,5]
B1 : [1,5,6]
B2 : [1,0,1]

I want to make 2 dropdowns, one will filter based on the letter (‘A’, ‘B’) and the other one filters based on number (1, 2). For instance, selecting A with the first dropdown will only display A1 and A2, and selecting B and 2 will select only B2. I have read the docs for plot.ly in javascript but only confused myself as the documentation is not very clear.

Also, is it possible to use regular dropdowns here? If possible, how does we integrate plotly graph with regular react objects? Thanks