MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / handleSyntaxClick

Function handleSyntaxClick

site/components/CodeBlock.js:68–83  ·  view source on GitHub ↗
(syntax)

Source from the content-addressed store, hash-verified

66 }
67
68 handleSyntaxClick(syntax) {
69 this.setState({
70 syntax,
71 chosen: true
72 });
73
74 const scrollTopBefore = findDOMNode(this).getBoundingClientRect().top;
75 setPreferredSyntax(syntax);
76 ReactUpdates.flushBatchedUpdates();
77 const scrollTopAfter = findDOMNode(this).getBoundingClientRect().top;
78
79 window.scroll(
80 window.pageXOffset || window.scrollX,
81 (window.pageYOffset || window.scrollY) - (scrollTopBefore - scrollTopAfter)
82 );
83 }
84
85 render() {
86 return (

Callers

nothing calls this directly

Calls 1

setPreferredSyntaxFunction · 0.85

Tested by

no test coverage detected