Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 8, 2019
1 parent 2fb8104 commit 3ea211c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion @antv/gatsby-theme-antv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
docs: [], // 用于定义文档页面的二级分类菜单
examples: [], // 用于定义演示页面的二级菜单,属性见下方
showLanguageSwitcher: true, // 用于定义是否展示语言切换
playpround: {
playground: {
container: '<canvas id="container" />', // 定义演示的渲染节点,默认 <div id="container" />
playgroundDidMount: 'console.log("playgroundDidMount");',
playgroundWillUnmount: 'console.log("playgroundWillUnmount");',
Expand Down
11 changes: 7 additions & 4 deletions @antv/gatsby-theme-antv/site/components/PlayGround.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PlayGround: React.FC<PlayGroundProps> = ({
}) => {
const { t } = useTranslation();
const fullscreenNode = useRef<HTMLDivElement>(null);
const playpround = useRef<HTMLDivElement>(null);
const playgroundNode = useRef<HTMLDivElement>(null);
const cmInstance = useRef<Editor>();
const [isFullScreen, updateIsFullScreen] = useState(false);
const [error, setError] = useState<Error | null>();
Expand All @@ -102,10 +102,10 @@ const PlayGround: React.FC<PlayGroundProps> = ({
};

useEffect(() => {
if (!compiledCode || !playpround || !playpround.current) {
if (!compiledCode || !playgroundNode || !playgroundNode.current) {
return;
}
execute(compiledCode, playpround.current, playground.container);
execute(compiledCode, playgroundNode.current, playground.container);
}, [compiledCode, error]);

useEffect(() => {
Expand Down Expand Up @@ -186,7 +186,10 @@ insertCss(`,
subTitle={<pre>{error && error.message}</pre>}
/>
) : (
<div ref={playpround} className={styles.exampleContainerWrapper} />
<div
ref={playgroundNode}
className={styles.exampleContainerWrapper}
/>
)}
</div>
<div className={styles.editor}>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
docs: [], // 用于定义文档页面的二级分类菜单
examples: [], // 用于定义演示页面的二级菜单,属性见下方
showLanguageSwitcher: true, // 用于定义是否展示语言切换
playpround: {
playground: {
container: '<canvas id="container" />', // 定义演示的渲染节点,默认 <div id="container" />
playgroundDidMount: 'console.log("playgroundDidMount");',
playgroundWillUnmount: 'console.log("playgroundWillUnmount");',
Expand Down

0 comments on commit 3ea211c

Please sign in to comment.