0
Answered
React Components
Does Textastic support es6 modules?
If so, I’m struggling to get it working in the app.
Specifically, I’d like to keep my React js components in separate files and import them where needed. Please assist.
Thanks.
Errol
Customer support service by UserEcho
Hello,
I assume you are talking about the web preview. Textastic uses a standard web view that uses the same WebKit engine as Safari. So, the web preview should support everything that is supported by Safari.
I tried a simple example I found at https://jakearchibald.com/2017/es-modules-in-browsers/ and it worked:
module.html:
utils.js:
If I preview module.html in Textastic by tapping the "glasses" icon, it shows the message "Modules are pretty cool.".
Brilliant! Works a treat! Thanks for your help Alexander.