nornj-react

5.3.5 • Public • Published

NornJ-React

React bindings for NornJ template engine.

NPM Version NPM Downloads

Install

npm install nornj-react

bindTemplate

You can use bindTemplate to register React components to NornJ template engine.

  • Class components
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import nj from 'nornj';
import { bindTemplate } from 'nornj-react';

@bindTemplate
class TestComponent extends Component {
  render() {
    return <i>{this.props.children}</i>;
  }
}

ReactDOM.render(nj`<TestComponent>test</TestComponent>`(), document.body);

In addition, bindTemplate also support a name parameter:

...
import { bindTemplate } from 'nornj-react';

@bindTemplate('test-Component')
class TestComponent extends Component {
  render() {
    return <i>{this.props.children}</i>;
  }
}

ReactDOM.render(nj`<test-Component>test</test-Component>`(), document.body);
  • Function components
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import nj from 'nornj';
import { bindTemplate } from 'nornj-react';

const TestComponent = bindTemplate('test-Component')(props => (
  <i>{props.children}</i>
));

ReactDOM.render(nj`<test-Component>test</test-Component>`(), document.body);

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.3.510latest
5.2.0-rc.91next

Version History

VersionDownloads (Last 7 Days)Published
5.3.510
5.3.41
5.3.31
5.3.22
5.3.11
5.3.02
5.2.80
5.2.70
5.2.61
5.2.51
5.2.40
5.2.30
5.2.20
5.2.10
5.2.01
5.2.0-rc.91
5.2.0-rc.80
5.2.0-rc.70
5.2.0-rc.60
5.2.0-rc.51
5.2.0-rc.40
5.2.0-rc.31
5.2.0-rc.21
5.2.0-rc.11
5.2.0-beta.52
5.2.0-beta.40
5.2.0-beta.31
5.2.0-beta.20
5.2.0-beta.10
5.1.11
5.1.00
5.0.70
5.0.61
5.0.50
5.0.40
5.0.30
5.0.20
5.0.10
5.0.00
5.0.0-rc.510
5.0.0-rc.501
5.0.0-rc.490
5.0.0-rc.480
5.0.0-rc.470
5.0.0-rc-461
5.0.0-rc.450
5.0.0-rc.442
5.0.0-rc.430
5.0.0-rc.420
5.0.0-rc.411
5.0.0-rc.402
5.0.0-rc.390
5.0.0-rc.181
5.0.0-rc.171
5.0.0-rc.161
5.0.0-rc.150
5.0.0-rc.141
5.0.0-rc.130
5.0.0-rc.121
5.0.0-rc.110
5.0.0-rc.102
5.0.0-rc.91
5.0.0-rc.80
5.0.0-rc.70
5.0.0-rc.60
5.0.0-rc.50
5.0.0-rc.41
5.0.0-rc.30
5.0.0-rc.20
5.0.0-rc.10
5.0.0-beta.80
5.0.0-beta.70
5.0.0-beta.60
5.0.0-beta.50
5.0.0-beta.41
5.0.0-beta.31
5.0.0-beta.20
5.0.0-beta.10
5.0.0-alpha.70
5.0.0-alpha.61
5.0.0-alpha.51
5.0.0-alpha.41
5.0.0-alpha.30
5.0.0-alpha.22
5.0.0-alpha.12
0.4.71
0.4.62
0.4.51
0.4.43
0.4.31
0.4.22
0.4.2-rc.101
0.4.2-rc.90
0.4.2-rc.82
0.4.2-rc.70
0.4.2-rc.61
0.4.2-rc.51
0.4.2-rc.40
0.4.2-rc.30
0.4.2-rc.20
0.4.2-rc.10
0.4.2-beta.130
0.4.2-beta.120
0.4.2-beta.110
0.4.2-beta.101
0.4.2-beta.91
0.4.2-beta.80
0.4.2-beta.70
0.4.2-beta.61
0.4.2-beta.51
0.4.2-beta.40
0.4.2-beta.30
0.4.2-beta.20
0.4.2-beta.10
0.4.2-alpha.51
0.4.2-alpha.41
0.4.2-alpha.30
0.4.2-alpha.21
0.4.2-alpha.10
0.4.10
0.4.1-rc.121
0.4.1-rc.110
0.4.1-rc.100
0.4.1-rc.90
0.4.1-rc.81
0.4.1-rc.70
0.4.1-rc.60
0.4.1-rc.50
0.4.1-rc.40
0.4.1-rc.32
0.4.1-rc.20
0.4.1-rc.11
0.4.0-rc.30
0.4.0-rc.21
0.4.0-rc.10

Package Sidebar

Install

npm i nornj-react

Weekly Downloads

83

Version

5.3.5

License

MIT

Unpacked Size

393 kB

Total Files

1417

Last publish

Collaborators

  • joe_sky