0

I want to use reactjs in my magento 2 module for designing or developing PWA.

edit:- how to integrate jqery with magento 2

2 Answers 2

0

you can use this magento module. This Simple module explains how to add and use React Components with Magento 2 and forgot about Knockout/JQuery Magento 2 UI

https://github.com/Genaker/reactmagento2

Update:-

Or you can use this code :-

// Include React JS itself 
<script src='https://npmcdn.com/[email protected]/dist/react-dom.min.js'></script>
// Include Babel to avoid compilation 
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>

//Add to the page to render React component
<div id = "magentoReactApp"> </div>

//Write your scripts using babel 
<script type="text/babel">

var App = React.createClass({
    render: function() {
        return(
            <div className="App">
                 {/*Your React Magento UI Component code there */}
            </div>
        );
    }
});
ReactDOM.render(
    <App />,
    document.getElementById('magentoReactApp')
);
</script>

for more details you can check this out https://medium.com/@egorshytikov/how-to-use-react-js-with-magento-2-ed5e9f3cf9fe

0

I would start with PWA studio, or a third party Magento 2 PWA that is built with React

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.