Module Warnings in console
Are you submitting a bug report or a feature request or a question?
bug report
What is the current behavior?
I am using react-select-async-paginate as shown below:
import Creatable from "react-select/creatable";
import { withAsyncPaginate } from "react-select-async-paginate";
const CreatableAsyncPaginate = withAsyncPaginate(Creatable);
// ...
const [value, onValueChange] = useState(null);
const [isAddingInProgress, setIsAddingInProgress] = useState(false);
const loadData = useCallback((query, loadedOptions, { page }) => {
return fetchMetronResource({
method: "GET",
resource: props.metronResource,
query: {
name: query,
page,
},
});
}, []);
return (
<CreatableAsyncPaginate
SelectComponent={Creatable}
debounceTimeout={200}
isDisabled={isAddingInProgress}
value={value}
loadOptions={loadData}
placeholder={props.placeholder}
// onCreateOption={onCreateOption}
onChange={onValueChange}
// cacheUniqs={[cacheUniq]}
additional={{
page: 1,
}}
/>
);
// ...
NOTE: The select populates with data, and paginates through it as it should.
However, the console shows these warnings:
"Module Warning (from ./node_modules/source-map-loader/index.js):
(Emitted value instead of an instance of Error) Cannot find source file '../src/index.tsx': Error: Can't resolve '../src/index.tsx' in '/Users/rishi/work/threetwo/node_modules/react-is-mounted-hook/lib'"
What is the expected behavior?
The warnings shouldn't be shown.
Sandbox Link
N/A
What's your environment?
{
"react": "^17.0.1",
"react-select": "^5.2.1",
"react-select-async-paginate": "^0.6.1"
}
Browser: Safari Version 15.3 (17612.4.2.1.2)
OS: macOS Monterey
Other information
Having a similar issue.
WARNING in ./node_modules/react-is-mounted-hook/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/react-is-mounted-hook/src/index.tsx' file: Error: ENOENT: no such file or directory, open '../node_modules/react-is-mounted-hook/src/index.tsx'
Its due to this issue: https://github.com/hupe1980/react-is-mounted-hook/issues/15
A very tiny lib that only add this:
import { useRef, useEffect, useCallback } from 'react';
export default function useIsMounted(): () => boolean {
const ref = useRef(false);
useEffect(() => {
ref.current = true;
return () => {
ref.current = false;
};
}, []);
return useCallback(() => ref.current, [ref]);
}
is it work @futhr your and how do i attach in my folder
@MoeThet20 A PR is required, I tried but this repo collides with my editors eslint config to much to do a proper clean PR, you welcome to give it a try.
Any update on this?
This library was removed in version 0.6.2