简体   繁体   中英

How to add existing react js app to saleforce?

I have a react js app built long time ago that uses 3rd party libraries and APIs, now I want to add this app to saleforce. Is there a way to add the existing react js app or do I have to build a new app using the saleforce development tools? Any advise and help is appreciated.

Can you live in an iframe? There's lightning:container tag that could help you. Search questions or blogs that mention it, on SO and on dedicated https://salesforce.stackexchange.com/ . Iframe sounds meh but there are ways for it to communicate with parent ("canvas apps" in documentation - and it has nothing to do with <canvas> tag), silently log in to SF, use REST API...

You could try to rewrite your app to native Aura/LWC but you won't be able to call APIs directly from JS. You'll have to pass through SF server-side language called Apex. Which is doable but more for you to learn. There are some more restrictions , although light DOM and LWS help with these, many things Locker service blocks are OK in LWS.

There's also hybrid approach with loading your app as a library ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM