Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created March 18, 2019 19:50
Show Gist options
  • Save ajcrites/f27c15e621f22daf84e4ced48e149636 to your computer and use it in GitHub Desktop.
Save ajcrites/f27c15e621f22daf84e4ced48e149636 to your computer and use it in GitHub Desktop.
@@ -1,6 +1,9 @@
-import React from 'react';
+import React, { useContext } from 'react';
+import { ColorToolContext } from '~/ColorToolAppContext';
+
+export const HexInput = () => {
+ const { hex, setHex, setRgba } = useContext(ColorToolContext);
-export const HexInput = ({ hex, setHex, setRgba }) => {
const onChange = ({ target: { value } }) => {
setHex(value);
setRgba(value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment