Archives : December-2016

could you please tell me how to render a list in react js. I do like this https://plnkr.co/edit/X9Ov5roJtTSk9YhqYUdp?p=preview class First extends React.Component { constructor (props){ super(props); } render() { const data =[{"name":"test1"},{"name":"test2"}]; const listItems = data.map((d) => <li key={d.name}>{d.name}</li>; return ( <div> hello </div> ); } } Source: React Router..

Read more

I’m having an issue with exception handling with [email protected] My router is attached like this: try { ReactDOM.render(<Router history={appHistory}> <Route path=’/’ component={Wrapper}> <Route path=’bad’ component={BadComponent}/> </Route> </Router>, domElement); } catch(ex) { ReactDOM.render(<Exception ex={ex}/>, domElement); } My issue is that if Wrapper throws a render exception we end up in the catch block. Great! If Wrapper ..

Read more

I create a menu and want to highlight the item which i choose,and i did it. But when i press back/forward button,the menu item don’t highlight. What should i do? I have tried to use addEventListener but failed. Have someone could give some advice? class Sidebar extends React.Component { constructor(props) { super(props); this.state={ test: “home” ..

Read more

I’m using React-Native-Router-Flux (V. 3.37) to build an Android app and I’m trying to create nested scenes. Using the DefaultRenderer element I have been able to create a single nested scene, but I’d like there to be multiple and to be able to navigate through them. My index.android.js looks something like this (within a Router ..

Read more