Skip to content

Instantly share code, notes, and snippets.

View jtrefry's full-sized avatar

James Trefry jtrefry

  • Northern California
View GitHub Profile
@jtrefry
jtrefry / StatelessComponent.js
Created October 29, 2015 18:38
File template for a React Stateless Component.
import React from 'react';
const ComponentName = (props) => (
<div></div>
);
export default ComponentName;
@jtrefry
jtrefry / RadioButtonGroup.js
Created October 13, 2016 00:45
RadioButtonGroup for Grommet RadioButtons
import React, { Component, PropTypes as t } from 'react';
import RadioButton from 'grommet/components/RadioButton';
import FormField from 'grommet/components/FormField';
class RadioButtonGroup extends Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
@jtrefry
jtrefry / Win10-64bit-npm.md
Last active September 6, 2023 07:30
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
import { useEffect, useState } from 'react';
const useMouseEvents = () => {
const [overlayStyles, setOverlayStyles] = useState<React.CSSProperties>({
display: 'none',
position: 'fixed',
backgroundColor: 'rgba(255, 255, 255, 0.9)',
padding: '10px',
border: '1px solid black',
zIndex: 9999,