From Aurelia to React and back


#1

Hi,
I have been trying to wrap react components to use them in Aurelia as described in https://github.com/ashleygrant/aurelia-loves-react for a while and so far it works quite well. However, many react components let the user specify templates that return user defined (react) markup to render certain aspects of a component. Take for example the PrimeReact’s datatable that lets the user customize table cell rendering.
I wonder if it is possible to use Aurelia for such templates? So I would then have a wrapped react component (e.g. the datatable) instantiated by Aurelia that would call the template function which would somehow render an Aurelia custom element (hence the title of this topic), for example.

Hope it’s somewhat understandable what I am trying to do :smiley:


#2

Yes that is doable with progressive enhancement. Essentially what it does is read a custom element that was e.g inserted via innerHtml and power it up so that Aurelia takes it over and enhances it to act as a staged component

Here are some links to get you started:

https://aurelia.io/docs/fundamentals/app-configuration-and-startup#leveraging-progressive-enhancement