typescript useref possibly null