Regular expression in React - 0 to 10 with two decimal places

I've spent the better part of an hour banging my head against the wall trying to get this to work. I want to allow for a number between 0 and 10 (inclusive) and two decimal points. For some reason I can't type in the decimal, which makes sense because it also give me a "no match" failure when I try it in regex testers. Can someone show me what I am missing?

 if (!rating || rating.match(/^(10|\d)(\.\d{1,2})?$/)) {
      this.setState(() => ({ rating })); 
  }