Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created March 18, 2019 19:31
Show Gist options
  • Select an option

  • Save ajcrites/1eda9e7419e4d2ca924c892e2599b3a2 to your computer and use it in GitHub Desktop.

Select an option

Save ajcrites/1eda9e7419e4d2ca924c892e2599b3a2 to your computer and use it in GitHub Desktop.
@@ -9,8 +9,8 @@ export const ColorToolApp = () => {
return (
<main>
- <HexInput hex={hex} setHex={setHex} />
- <RgbaInput rgba={rgba} setRgba={setRgba} />
+ <HexInput hex={hex} setHex={setHex} setRgba={setRgba} />
+ <RgbaInput rgba={rgba} setRgba={setRgba} setHex={setHex} />
</main>
);
};
@@ -1,8 +1,9 @@
import React from 'react';
-export const HexInput = ({ hex, setHex }) => {
+export const HexInput = ({ hex, setHex, setRgba }) => {
const onChange = ({ target: { value } }) => {
setHex(value);
+ setRgba(value);
};
return (
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment