nnajm / orb

Pivot table javascript library
https://nnajm.github.io/orb/
MIT License
556 stars 173 forks source link

Mixing Orb 1.1.0 with popular Redux boilerplates #46

Open reactima opened 8 years ago

reactima commented 8 years ago

Hi, thanx for great work!

Mixing Orb 1.1.0 with popular Redux boilerplates isn't straightforward process.

Instead of going from

import ord from 'orb' 

and smth like

<orb config={config} /> 

I ended up with the following code:

import React, {Component, PropTypes} from 'react';
import ReactDOM from 'react-dom';

window.React = React;
window.ReactDOM = ReactDOM;
const orb = require('orb');

const config = { ... };

const myPivot = new orb.pgridwidget(config);
const elem = document.getElementById('rr');

myPivot.render(elem);

export default class PlainComponent extends Component {
// >> I would like to use myPivot here
}

... and it's not the best practice as i'm rendering in two separate divs.

Would you please share example how to use Orb as normal react 0.14 component?

export default class Orb extends Component {
  constructor() {
    super();
  }

  render() {
    return ( );
  }
}

It would be really nice to make Orb isomorphic and ES6 friendly as well.

Is there recommended way to use Orb 1.1.0. inside react 0.14 compatible components?

datuary-jmartinez commented 8 years ago

Hello @reactima. Any update about this?. I am trying to integrate orb with React 0.14 but I received an error:

Uncaught TypeError: Cannot read property 'createClass' of undefined

Do you have any example that you could share?.

Thank you