https://react-bootstrap.github.io/
- no webpack dependencies
- requires less-loader
https://react-bootstrap.github.io/
naïve approach
let's use javascript, then!
| class Example extends React.Component { | |
| onClick(e, id) { | |
| ... | |
| } | |
| render() { | |
| return <ul>{this.props.items.map((el, i) => <li onClick={this.onClick.bind(this, el.id)}>{el.description}</li>)</ul> | |
| } | |
| } | |
| /// OR........ |
| export function tryparseJson(jsonstring) { | |
| try { | |
| return JSON.parse(jsonstring); | |
| } catch (e) { | |
| return false; | |
| } | |
| } |
| const React = require('react'); | |
| const ReactDOM = require('react-dom'); | |
| const TodoInput = require('./todo_input.js'); | |
| const TodoList = require('./todo_list.js'); | |
| var tasks = [ | |
| { text : 'buy milk' }, | |
| { text : 'do exercises' } | |
| ]; |
| import App from './App'; | |
| import './index.css'; | |
| import {render} from './statemachine'; | |
| render( | |
| App, | |
| {}, | |
| document.getElementById('root') | |
| ); |
| const sql = require('mssql'); | |
| const Promise = require('bluebird'); | |
| Promise.promisifyAll([ | |
| sql.Connection, | |
| ]); | |
| const createConnection = connectionOptions => { | |
| const connection = new sql.Connection(connectionOptions); | |
| return connection.connectAsync().then(() => { |
| const server = new WebSocket("ws://localhost:3000"); | |
| export default const server = { | |
| sendmessage: () => { | |
| return server.onmessage = () => {} | |
| } | |
| } |
| { | |
| "ecmaFeatures": { | |
| "jsx": true, | |
| "modules": true | |
| }, | |
| "env": { | |
| "browser": true, | |
| "es6": true, | |
| "node": true, | |
| "jquery": false |
| var Question = React.createClass({ | |
| onChangeTitle: function (e) { | |
| this.props.qTitleCallback(this.props.ordering, e); | |
| }, | |
| onChangeType: function (e) { | |
| this.props.qTypeCallback(this.props.ordering, e); | |
| }, | |
| render: function() { | |
| return ( | |
| <div> |