Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David Meents dmeents

View GitHub Profile
@dmeents
dmeents / form-fields.js
Last active Nov 22, 2018
Rendering a select field in Redux-Form 6 with validation
View form-fields.js
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
export const renderSelect = field => (
<div>
<select {...field.input}/>
{field.touched && field.error && <div className="error">{field.error}</div>}
</div>
);
@dmeents
dmeents / _ticket-control.js
Created Aug 9, 2016
How to create a React.js ticketing system using Redux-Form and a MongoDB
View _ticket-control.js
//server/controllers/_ticket-control.js
'use strict';
const Tickets = require('../models/tickets');
//===================
// Create Tickets Route
//===================
exports.createTicket = function(req, res, next) {
@dmeents
dmeents / redux-form-tut.js
Created Aug 6, 2016
The source code for the redux form tutorial on davidmeents.com
View redux-form-tut.js
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import * as actions from '../../actions';
const form = reduxForm({
form: 'ReduxFormTutorial',
validate
});
View reactable-tutorial.js
//======================
// IMPORT
//======================
import React, { Component } from 'react';
import Reactable from 'reactable';
var Table = Reactable.Table,
Thead = Reactable.Thead,
Th = Reactable.Th;
@dmeents
dmeents / navigation.js
Created Jul 19, 2016
The complete source code for the Creating a collapsible navigation menu in react
View navigation.js
import React, { Component } from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';
import MobileNav from 'react-icons/lib/io/navicon-round';
//navigation display
export default class NavContainer extends Component {
constructor(props) {
super(props);
this.state = {
You can’t perform that action at this time.