@trp/react-framework
## **Note:-** This is a work in progress and not complete.(I am still working on it.)
Last updated 3 years ago by besrabasant .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @trp/react-framework 
SYNC missed versions from official npm registry.

react-framework

Note:- This is a work in progress and not complete.(I am still working on it.)

Installation

To install this package, run:

npm install --save @trp/react-framework

This assumes that you are using npm as your package manager.

#Usage

In your React Project root file assuming here as

index.js

import React from 'react'
import ReactDOM from 'react-dom'
import ReactFramework from "@trp/react-framework"
import Config from "./Config"

// initialize the registry of the framework.
ReactFramework.initialiseRegistry(Config);

// Create your React App
let App = ReactFramework.createApp();

let mountNode = document.getElementById('app-root') 

if (mountNode && App !== null) {
    ReactDOM.render(<App />, mountNode);
}

Now in your ./Config.js file

import { HelloWorldModule } from "./Modules/HelloWorld"


export default {
    modules: [
        HelloWorldModule
    ]
}

Define all your Modules in a Modules directory

Now in your ./Modules/HelloWorld directory, create a file named index.js

In your module index.js

import { RFModule } from "@trp/react-framework/Module"
import React from "react"



class HelloWorldComponent extends React.Component {
    render() {
        <h1>I am your Hello World Component.</h1>
    }
}




@RFModule({
    ModuleName: "HelloWorld",   // name of your module
    layoutComponents: {
        "App.EmptyLayout": {    // The Layout where your Component gets rendered.
            main: [             // The Section of the Layout.
                HelloWorldComponent
            ]
        }
    }
})
export class HelloWorldModule {}

Here we are telling React Framework to render our HelloWorldComponent to render inside the main section of the layout named EmptyLayout of the main App module.

Current Tags

  • 1.1.2                                ...           latest (3 years ago)

4 Versions

  • 1.1.2                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 2
Last Day 0
Last Week 1
Last Month 1
Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |