Can react mount global api like vue?

the vue,vue that was used before I just came into contact with react, can be mounted in the following way

import api from "./tool/api"
Vue.prototype.$api = api

try react but block page rendering, is it the wrong method I use, or can"t I do it in the first place? How do you use it if you want to achieve the effect of vue?

Jul.06,2021

can be used like this:

  Context of React  learn about 

Menu