0

How to use 'require' from older version of react-native instead of the import in the new versions

1 Answer 1

1

If you export your module like this: module.exports = moduleName; You should import using var moduleName = require('moduleName');

If export your module using export default moduleName. You should import using import ModuleName from './ModuleName;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.