react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Warning after importing react-native-paper : Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

Open Steffi3rd opened this issue 7 years ago • 21 comments

Capture d’écran 2019-03-16 à 12 16 32

Steffi3rd avatar Mar 16 '19 11:03 Steffi3rd

Same problem...

max10rogerio avatar Mar 18 '19 23:03 max10rogerio

Duplicate of #639

satya164 avatar Mar 18 '19 23:03 satya164

I`m still getting the warnings, what could it be?

M4urici0GM avatar Feb 10 '20 17:02 M4urici0GM

I`m still getting the warnings, what could it be?

Check this out : https://stackoverflow.com/questions/55664673/require-cycles-are-allowed-but-can-result-in-uninitialized-values-consider-ref/58459108#58459108

gitmudassir avatar Feb 11 '20 01:02 gitmudassir

Still getting this issue.

harveyconnor avatar Feb 27 '20 01:02 harveyconnor

@harveyconnor

Import each Item separate , for example you need a List Section with an accordion and a list item so go like :

import ListSection from 'react-native-paper/lib/commonjs/components/List/ListSection'; import ListAccordion from 'react-native-paper/lib/commonjs/components/List/ListAccordion'; import ListItem from 'react-native-paper/lib/commonjs/components/List/ListItem';

And then instead of <List.Section> (like in the docs) you use < ListSection > . That should be enough

felipeinfantino avatar Apr 23 '20 10:04 felipeinfantino

I solved this issue by doing this. Place the import 'react-native-paper' at the very top of the Code.

Ulfsaar-dev avatar May 27 '20 16:05 Ulfsaar-dev

A PR to fix this issue is open here https://github.com/callstack/react-native-paper/pull/1851. Please be patient it will be merged soon.

raajnadar avatar May 27 '20 16:05 raajnadar

it solved this issue by doing this. Place the import 'react-native-paper' at the very top of the Code. in the Index.js

Alvarotony17 avatar Jun 01 '20 04:06 Alvarotony17

i am still facing the issue. RN - version 62.2 "react-native-paper": "^3.10.1", please help. i am able to see blank screen on my emulator.

jyotiprakash111 avatar Jun 22 '20 09:06 jyotiprakash111

Place import { Provider as PaperProvider } from 'react-native-paper'; directly after import React from 'react';, otherwise you'll get those warnings.

fxbayuanggara avatar Jun 24 '20 11:06 fxbayuanggara

Place import { Provider as PaperProvider } from 'react-native-paper'; directly after import React from 'react';, otherwise you'll get those warnings.

This worked, totally forgot to wrap the entire app in this

vivian-verys avatar Jul 01 '20 05:07 vivian-verys

any update on this issue?

hungvu193 avatar Sep 18 '20 07:09 hungvu193

Still happening here as well. I'm hiding those warnings but it's not ideal.

waterydan avatar Oct 17 '20 09:10 waterydan

LogBox.ignoreLogs(["Require cycle:"]);

anonewb avatar Oct 21 '20 15:10 anonewb

still getting this issue

samuelseaton avatar Oct 29 '20 19:10 samuelseaton

why is this closed? still getting same error on "react-native-paper": "^4.4.1" and "react-native": "0.63.3". Any workaround yet?

kpose avatar Nov 23 '20 15:11 kpose

@harveyconnor

Import each Item separate , for example you need a List Section with an accordion and a list item so go like :

import ListSection from 'react-native-paper/lib/commonjs/components/List/ListSection'; import ListAccordion from 'react-native-paper/lib/commonjs/components/List/ListAccordion'; import ListItem from 'react-native-paper/lib/commonjs/components/List/ListItem';

And then instead of <List.Section> (like in the docs) you use < ListSection > . That should be enough

For people wondering ... This Fixed my problem...

BatDroid avatar Nov 23 '20 16:11 BatDroid

@harveyconnor

@BatDroid's suggestion worked well for me. In my index.js file I imported directly from the modules' directory.

instead of

import {Provider as PaperProvider} from 'react-native-paper';

try importing like:

import PageProvider from 'react-native-paper/lib/commonjs/core/Provider';

It works well for me!

josiaharkson avatar Dec 07 '20 20:12 josiaharkson

still looking for a solution

kamalkemo avatar Dec 14 '20 15:12 kamalkemo