planning
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Mateusz Burzyński
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+26
View File
@@ -0,0 +1,26 @@
# use-isomorphic-layout-effect
A React helper hook for scheduling a layout effect with a fallback to a regular effect for environments where layout effects should not be used (such as server-side rendering).
## Installation
```sh
$ npm i use-isomorphic-layout-effect
```
## Usage
You only need to switch `useLayoutEffect` with `useIsomorphicLayoutEffect`
```diff
+ import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';
- import { useLayoutEffect } from 'react';
const YourComponent = () => {
+ useIsomorphicLayoutEffect(() => {
- useLayoutEffect(() => {
// your implementation
}, []);
};
```
@@ -0,0 +1,3 @@
import { useLayoutEffect } from 'react';
declare const _default: typeof useLayoutEffect;
export default _default;
@@ -0,0 +1,9 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react = require('react');
var index = react.useLayoutEffect ;
exports.default = index;
@@ -0,0 +1,5 @@
import { useLayoutEffect } from 'react';
var index = useLayoutEffect ;
export default index;
@@ -0,0 +1,2 @@
export * from "./declarations/src/index";
export { default } from "./declarations/src/index";
@@ -0,0 +1,9 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react = require('react');
var index = typeof document !== 'undefined' ? react.useLayoutEffect : react.useEffect;
exports.default = index;
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === "production") {
module.exports = require("./use-isomorphic-layout-effect.cjs.prod.js");
} else {
module.exports = require("./use-isomorphic-layout-effect.cjs.dev.js");
}
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
var react = require("react"), index = "undefined" != typeof document ? react.useLayoutEffect : react.useEffect;
exports.default = index;
@@ -0,0 +1,5 @@
import { useLayoutEffect, useEffect } from 'react';
var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
export default index;
@@ -0,0 +1,3 @@
import { useLayoutEffect } from 'react'
export default useLayoutEffect
+51
View File
@@ -0,0 +1,51 @@
{
"name": "use-isomorphic-layout-effect",
"version": "1.1.2",
"description": "A React helper hook for scheduling a layout effect with a fallback to a regular effect for environments where layout effects should not be used (such as server-side rendering).",
"main": "dist/use-isomorphic-layout-effect.cjs.js",
"module": "dist/use-isomorphic-layout-effect.esm.js",
"react-native": "./dist/use-isomorphic-layout-effect.native.esm.js",
"browser": {
"./dist/use-isomorphic-layout-effect.cjs.js": "./dist/use-isomorphic-layout-effect.browser.cjs.js",
"./dist/use-isomorphic-layout-effect.esm.js": "./dist/use-isomorphic-layout-effect.browser.esm.js"
},
"files": [
"dist"
],
"scripts": {
"test": "echo \"Warning: no test specified\"",
"build": "preconstruct build",
"postbuild": "cpy 'src/index.native.ts' . --rename=$npm_package_react_native",
"prepare": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Andarist/use-isomorphic-layout-effect.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/Andarist/use-isomorphic-layout-effect/issues"
},
"homepage": "https://github.com/Andarist/use-isomorphic-layout-effect#readme",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"devDependencies": {
"@babel/core": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@preconstruct/cli": "1.1.14",
"@types/react": "^16.9.41",
"cpy-cli": "^3.1.1",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5",
"react": "^16.13.1",
"typescript": "^3.9.5"
}
}