Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Awni Gharbia awnigharbia

🎯
Focusing
Block or report user

Report or block awnigharbia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@markerikson
markerikson / render-logic.js
Last active Sep 1, 2019
React render function organization
View render-logic.js
class ParentComponent extends Component {
render() {
// My basic render function structure:
// 1) Extract values from props and state
const {a, b, someBoolean, someList} = this.props;
// 2) Render any dependent items into temporary variables, such as conditional components or lists
const conditionalComponent = someBoolean ? <SomeComponent /> : null;
const listItems = someList.map(item => <ListItem item={item} />);
@krambertech
krambertech / Component.jsx
Created Jul 2, 2016
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
View Component.jsx
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
You can’t perform that action at this time.