I'm trying to import a module only for IE11, https://react-hook-form.com/faqs/, and then re-import it in another file.
// utils/index.js
let loadModule;
if (isIE11) {
loadModule = require('react-hook-form/dist/index.ie11');
} else {
loadModule = require('react-hook-form');
}
module.exports = { ...loadModule };
// import it in another file
import {useForm} from './utils/index';
...
The question would be if this is possible to do it with import/export, and if my code would be the proper way to handle this case