Update RPCPreview.tsx to wrap conditional renders and ensure consistent getStorage calls.
This commit is contained in:
parent
2952034d7d
commit
c8271d19a9
1 changed files with 23 additions and 0 deletions
23
RPCPreview.tsx
Normal file
23
RPCPreview.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
// Updated RPCPreview.tsx to properly wrap all conditional renders and ensure getStorage is called consistently.
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { getStorage } from './storage';
|
||||||
|
|
||||||
|
const RPCPreview = () => {
|
||||||
|
const storageData = getStorage();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{storageData ? (
|
||||||
|
<div>
|
||||||
|
{/* Conditional render based on storageData */}
|
||||||
|
{storageData.isAvailable ? <AvailableComponent /> : <UnavailableComponent />}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div>Loading...</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RPCPreview;
|
||||||
Loading…
Add table
Reference in a new issue