反应三元运算符同时运行两个条件

Hello I have this ternary operator to see if an user has access to a page, the towAccess value is true but it still would redirect me to /403

这是我的代码:

towAccess ?
    <Component {...props} /> : window.location = "/403"

谢谢卡斯珀!