How to transform require form into import from form

when react native is developed, other people"s official documents are written as

introduced in the following form
global.PaymentRequest = require("react-native-payments").PaymentRequest;

but now I want to introduce
in the form of import xxxx from, so the problem arises. How do I convert it when I encounter the format of require (xxxx). PaymentRequest?

clipboard.png

Mar.28,2021

import {PaymentRequest} from 'react-native-payments'


import { PaymentRequest } from 'react-native-payments';
global.PaymentRequest = PaymentRequest;
Menu