react check if window exists code example
Example 1: python check if file exists
import os
os.path.exists("file.txt") # Or folder, will return true or false
Example 2: js check if function exists
if (typeof yourFunctionName == 'function') {
yourFunctionName();
}
Example 3: react check if window exists
if (typeof window !== 'undefined') {
let paypal = require('paypal-checkout');
}