i want to use flashlist
to render items to the screen , acording to the docs the only thing that we need to do is to rename the component and add estimatedItemSize
attribute to the component , so i did it but i got this weird error .
component code :
export const RestaurantsScreen = () => {
const { isLoading, error, clearError, sendRequest } = useHttpClient();
const [fetchedRestaurants, setFetchedRestaurants] = useState([]);
...
...
...
{!isLoading && fetchedRestaurants.length > 0 && (
<FlashList
data={fetchedRestaurants}
renderItem={renderItemComponent}
keyExtractor={(item) => item.name}
initialNumToRender={3}
estimatedItemSize={15}
/>
)}
</SafeArea>
);
};
and the error is :
Invariant Violation: requireNativeComponent: "AutoLayoutView" was not found in the UIManager.
This error is located at:
in AutoLayoutView (created by AutoLayoutView)
in AutoLayoutView (created by ScrollComponent)
in RCTView (created by View)
in View (created by ScrollComponent)
in ...
it works fine with flatlist
.
i want to use flashlist
to render items to the screen , acording to the docs the only thing that we need to do is to rename the component and add estimatedItemSize
attribute to the component , so i did it but i got this weird error .
component code :
export const RestaurantsScreen = () => {
const { isLoading, error, clearError, sendRequest } = useHttpClient();
const [fetchedRestaurants, setFetchedRestaurants] = useState([]);
...
...
...
{!isLoading && fetchedRestaurants.length > 0 && (
<FlashList
data={fetchedRestaurants}
renderItem={renderItemComponent}
keyExtractor={(item) => item.name}
initialNumToRender={3}
estimatedItemSize={15}
/>
)}
</SafeArea>
);
};
and the error is :
Invariant Violation: requireNativeComponent: "AutoLayoutView" was not found in the UIManager.
This error is located at:
in AutoLayoutView (created by AutoLayoutView)
in AutoLayoutView (created by ScrollComponent)
in RCTView (created by View)
in View (created by ScrollComponent)
in ...
it works fine with flatlist
.
6 Answers
Reset to default 12The reason for this is that flashlist module has native dependencies (this is why installation docs prompts you to install the native deps with pod install
in the ios directory).
Whenever you change anything on the "native" side of things you need to rebuild the app via xCode (or with yarn ios
).
After that you will not see the error anymore