Build a JavaScript Calculator doubt

I have finished the calculator project using React.
i used built in javascript method eval() for calculating the expression values entered in the calculator after modifying them according to project requirements.
My question is,is there a better way of doing it?I read online that eval is not safe and is pretty resource consuming.
Ofcourse i can parse the input and write the logic myself but are there any javascript alternatives?.

hey,
thanks for the feedback.
I am not calculating for expressions with no digits before the decimal point.I have fixed that.
More importantly I was asking about alternative ways than using java eval.