chore(warnings): only print for node_env=development

This commit is contained in:
moklick
2022-05-02 14:57:38 +02:00
parent 2e9a203c0e
commit 18be5f1773
6 changed files with 19 additions and 8 deletions
+4 -3
View File
@@ -38,13 +38,14 @@ export function useMarkerSymbol(type: MarkerType) {
const symbol = useMemo(() => {
const symbolExists = MarkerSymbols.hasOwnProperty(type);
if (process.env.NODE_ENV === 'development') {
if (!symbolExists) {
if (!symbolExists) {
// @ts-ignore
if (process.env.NODE_ENV === 'development') {
console.warn(
`[React Flow]: Marker type "${type}" doesn't exist. Help: https://reactflow.dev/error-decoder#900`
);
return () => null;
}
return () => null;
}
return MarkerSymbols[type];