UNPKG

jquery-react-render

Version:

Render React Component Using Jquery

76 lines (51 loc) 2.08 kB
# [jquery react render](https://npmjs.com/package/jquery-react-render) [![NPM](https://nodei.co/npm/jquery-react-render.png?stars=true&downloads=true)](https://npmjs.com/package/jquery-react-render) If you love to use Jquery and react... this is for you! You can pass a react component or html element and append it where you want... in react style **jquery-react-render** by [Dario Passariello](https://dario.passariello.ca) (c) [![version](https://img.shields.io/npm/v/jquery-react-render.svg)](https://npmjs.org/package/jquery-react-render) [![downloads](https://img.shields.io/npm/dm/jquery-react-render.svg)](https://npmjs.org/package/jquery-react-render) ![TypeScript](https://img.shields.io/badge/TypeScript-gray?logo=typescript) ![jquery](https://img.shields.io/badge/jquery-gray?logo=jquery) ![ESLint](https://img.shields.io/badge/ESLint-gray?logo=eslint) ![ESBuild](https://img.shields.io/badge/ESBuild-gray?logo=ESBuild) ![License](https://img.shields.io/badge/license-MIT-blue.svg) > NOTE: if you have intention to use exclusively in react please, use ["REACT-ATTACK"](https://www.npmjs.com/package/react-attack) instead. ## install ```sh npm i -D jquery-react-render ``` You use: If your app is an SPA you need to import only one time at first script ```js import "jquery-react-render" ``` ## Example in vanilla js ```js $("body").react( // The main element where you want you component "#jrr", // example: the name of container <div> This is just a test </div> ) ``` ## Example in React ```js import react from "React" import "jquery-react-render" export const Test = () => { useEffect( ()=>{ $("body").react( // The main element where you want you component "#jrr", // example: the name of container <div> This is just a test </div> ) },[] ) return <div>TEST</div> } ``` Copyright by Dario Passariello (c) 2025 all rights reserved - <dariopassariello@gmail.com>