Skip to content

Commit

Permalink
Fixed constant redraws caused by reference comparison instead of valu…
Browse files Browse the repository at this point in the history
…e comparison
  • Loading branch information
FoolRunning committed Jun 28, 2023
1 parent 9164711 commit 988bbc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions/lib/hello-world/hello-world.web-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
} from 'papi-components';
import { QuickVerseDataTypes } from '@extensions/quick-verse/quick-verse';
import { PeopleDataProvider, PeopleDataTypes } from '@extensions/hello-someone/hello-someone';
import { type UsfmProviderDataTypes } from '@extensions/external-usfm-data-provider';
import type { UsfmProviderDataTypes } from '@extensions/external-usfm-data-provider';
import type { DataProviderDataType } from 'shared/models/data-provider.model';
import { Key, useCallback, useContext, useState } from 'react';
import { Key, useCallback, useContext, useMemo, useState } from 'react';

type Row = {
id: string;
Expand Down Expand Up @@ -97,13 +97,13 @@ globalThis.webViewComponent = function HelloWorld() {

const [psalm1] = useData.Chapter<UsfmProviderDataTypes, 'Chapter'>(
'usfm',
{ book: 'PSA', chapter: '1', verse: '1', versification: 'English' },
useMemo(() => ({ book: 'PSA', chapter: '1', verse: '1', versification: 'English' }), []),
'Loading Psalm 1...',
);

const [john11] = useData.Verse<UsfmProviderDataTypes, 'Verse'>(
'usfm',
{ verseString: 'JHN 1:1' },
useMemo(() => ({ verseString: 'JHN 1:1' }), []),
'Loading John 1:1...',
);

Expand Down

0 comments on commit 988bbc1

Please sign in to comment.