It requires that R&D generally be expensed as incurred now.
So, in QBO, it should be considered an Overhead Expense, not Direct Cost or COGS.
How to set up R&D as Overhead (O/H) in new QuickBooks Online?
Figure out the main primary operating costs for R&D and categorize expense type.
In QBO chart of accounts detail type are already defined. I would select “Other miscellaneous service cost” as detail type to track costs related to R&D.
For example your Chart of Accounts should like this:

R&D Expense:
- Salary and Benefits
- Purchased Materials
- Independent Contractors
- Equipment Expense
- Travel Expense
- Other R&D Expense
This is just an example. Only your CPA can give you better guidance for your business.