Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add React 16 support #9

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
"modules": false,
"bugfixes": true
}],
["@babel/preset-react", {
"runtime": "automatic"
}],
["@babel/preset-react"],
["@babel/preset-typescript", {
"isTSX": true,
"allExtensions": true
Expand Down
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-unused-expressions": "error",
"prettier/prettier": "error",
"react/display-name": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
"prettier/prettier": "error"
}
}
2 changes: 1 addition & 1 deletion demo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StrictMode } from "react";
import React, { StrictMode } from "react";
import { render } from "react-dom";
import { ColorPicker, useColor } from "../src";
import "../src/css/styles.css";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"test": "yarn test:lint && yarn test:typescript",
"build:js": "rollup --config rollup.config.ts",
"build:types": "tsc --emitDeclarationOnly",
"prebuild": "del-cli lib",
"prebuild": "yarn test && del-cli lib",
"build": "yarn build:js && yarn build:types",
"predemo:build": "del-cli demo/build",
"demo:build": "parcel build demo/index.html --dist-dir demo/build --target demo --public-url . --no-source-maps",
Expand All @@ -72,7 +72,7 @@
"release": "git push --follow-tags origin master"
},
"peerDependencies": {
"react": "^17.0.1"
"react": ">=16.8.0"
},
"devDependencies": {
"@babel/core": "^7.13.16",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const config = {
format: "es",
},
],
external: ["react", "react/jsx-runtime"],
external: ["react"],
plugins: [
nodeResolve({
extensions,
Expand Down
1 change: 1 addition & 0 deletions src/components/ColorPicker.component.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { ColorPickerProps } from "../interfaces/ColorPicker.interface";
import { Saturation } from "./Saturation.component";
import { Hue } from "./Hue.component";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Fields.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useState, useEffect } from "react";
import React, { useCallback, useState, useEffect } from "react";
import { UpperFloorProps, LowerFloorProps, FieldsProps } from "../interfaces/Fields.interface";
import { toHsv, toRgb } from "../utils/convert.util";
import { toColor } from "../utils/toColor.util";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Hue.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from "react";
import React, { useMemo } from "react";
import { HueProps } from "../interfaces/Hue.interface";
import { getHueCoordinates } from "../utils/coordinates.util";
import { toColor } from "../utils/toColor.util";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Interactive.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useRef } from "react";
import React, { useRef } from "react";
import { InteractiveProps } from "../interfaces/Interactive.interface";
import { clamp } from "../utils/clamp.util";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Saturation.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from "react";
import React, { useMemo } from "react";
import { SaturationProps } from "../interfaces/Saturation.interface";
import { getColorCoordinates } from "../utils/coordinates.util";
import { toColor } from "../utils/toColor.util";
Expand Down
8 changes: 2 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"module": "ESNext",
"moduleResolution": "Node",
"outDir": "lib",
"jsx": "react-jsx",
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"jsx": "react",
"lib": ["ESNext", "DOM"],
"allowJs": true,
"strict": true,
"declaration": true,
Expand Down