Skip to content

Commit

Permalink
chore(docs): update type of state.events.selected in useNode hook (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzhrookie authored and prevwong committed May 17, 2024
1 parent 4fa9b46 commit 1212856
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/docs/guides/basic-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ The `useNode` hook accepts a collector function which can be used to retrieve st
// components/user/Text.js
export const Text = ({text, fontSize}) => {
const { connectors: {connect, drag}, hasSelectedNode, hasDraggedNode, actions: {setProp} } = useNode((state) => ({
hasSelectedNode: state.events.selected.size > 0,
hasDraggedNode: state.events.dragged.size > 0
hasSelectedNode: state.events.selected,
hasDraggedNode: state.events.dragged
}));

const [editable, setEditable] = useState(false);
Expand Down Expand Up @@ -668,8 +668,8 @@ import {Slider, FormControl, FormLabel} from "@material-ui/core";

export const Text= ({text, fontSize, textAlign}) => {
const { connectors: {connect, drag}, hasSelectedNode, hasDraggedNode, actions: {setProp} } = useNode((state) => ({
hasSelectedNode: state.events.selected.size > 0,
hasDraggedNode: state.events.dragged.size > 0
hasSelectedNode: state.events.selected,
hasDraggedNode: state.events.dragged
}));

...
Expand Down

0 comments on commit 1212856

Please sign in to comment.