New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jreact-lib

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jreact-lib

React for the 2.0 web

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

JReact

JReact is a modern declarative UI framework inspired by React that uses the full power of jQuery under the hood.

import Jreact, {render} from 'jreact';

import App from './components/App';

render(() => <App/>, document.getElementById('app'));

Usage

Set your jsx pragma to Jreact in babelrc

{
  "presets": [
    "@babel/preset-env", 
    ["@babel/preset-react",{
      "pragma": "Jreact",
      "throwIfNamespace": false 
    }
    ]
  ]
}

Then do not use fragments and make sure to escape your html.

You can also use useState and useEffect hooks.

import Jreact, {useState, useEffect} from 'jreact';

const Clock = ({children}) => {
  const [time, setTime] = useState(Date.now())
  useEffect(()=>{
    setInterval(()=>{
      setTime(Date.now())
    },1000)
  },[])
  return (
    <div>
      {new Date(time).getHours()}:
      {new Date(time).getMinutes()}:
      {new Date(time).getSeconds()}
    </div>
  )
}

Keywords

node

FAQs

Package last updated on 02 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts