React(strap): How to get this functionality?

Hi, I did the whole FCC course a while ago, and now I’m trying to get an idea what I need to build such a form to make auto conversions:
It should have four user input lines:

  1. Price of commodity X in USD
  2. Price of commodity X in YUAN
  3. Price of commodity Y in relation to X in USD
  4. Price of commodity Y in relation to X in USD

When the user fills in a number in either of the lines the rest are filled automatically from data pulled from a remote api.

I’m a bit confused on exactly what the form needs to do. What exactly is ‘price of commodity Y’?

As far as the rest of the form automatically filling out, this is just some state alterations in a component.

Well, do you know an example with a class that does that? It’d be easiest to start from a similar example…

Are you suggesting a class-based component in React that changes the input fields based on an API call?

I can help with that but I am confused about 3 and 4 in your form. Are you saying you have two items and you want to compare the prices in both USD & YUAN?

Are you suggesting a class-based component in React that changes the input fields based on an API call?

That’s what I meant, yes.

Are you saying you have two items and you want to compare the prices in both USD & YUAN?

It means there are 2 data: one is the USD/YUAN conversion rate, and the other is the X/Y ratio. From that data all the other fields are filled in automatically.