Skip to content

Commit

Permalink
🐛 fix: 移除 use-merge-value 以修正 hooks bug
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jun 18, 2021
1 parent dd352a6 commit 9e72f6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions packages/asset-gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"antd": "^4.14.0",
"copy-to-clipboard": "^3.3.1",
"js-yaml": "^4.1.0",
"styled-components": "^5.3.0",
"use-merge-value": "^1.0.2"
"styled-components": "^5.3.0"
}
}
10 changes: 5 additions & 5 deletions packages/asset-gallery/src/AssetGallery.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC } from 'react';
import React from 'react';
import useMergeValue from 'use-merge-value';
import React, { useState } from 'react';
// import useMergeValue from 'use-merge-value';

import Layout from './Layout';

Expand Down Expand Up @@ -45,11 +45,11 @@ const AssetGallery: FC<AssetGalleryProps> = ({
data,
darkBackground,
layout = 'masonry',
grid = { columns: 1, showSlider: true },
grid = { showSlider: true },
}) => {
const imageList = typeof data === 'string' ? YMLToJSON(data).data : data;
const [columns, setColumn] = useState(1);

const [columns, setColumn] = useMergeValue(grid.columns);
const imageList = typeof data === 'string' ? YMLToJSON(data).data : data;

return (
<Layout
Expand Down

0 comments on commit 9e72f6a

Please sign in to comment.