From a031dffd2a93c0ce0fbd94a78825a6bce01b8334 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Sat, 23 Feb 2019 11:25:11 +0200 Subject: [PATCH] feat(Popup): support an object from `createRef()` as context value (#3459) --- .../Popup/Usage/PopupExampleContext.js | 18 +++++++++--------- .../Usage/PopupExampleContextControlled.js | 19 +++++++++++-------- src/modules/Popup/Popup.d.ts | 2 +- src/modules/Popup/Popup.js | 10 ++++++++-- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/docs/src/examples/modules/Popup/Usage/PopupExampleContext.js b/docs/src/examples/modules/Popup/Usage/PopupExampleContext.js index 1aba53511a..d721b141a7 100644 --- a/docs/src/examples/modules/Popup/Usage/PopupExampleContext.js +++ b/docs/src/examples/modules/Popup/Usage/PopupExampleContext.js @@ -1,20 +1,20 @@ -import React from 'react' +import React, { createRef } from 'react' import { Button, Popup } from 'semantic-ui-react' class PopupExampleContextControlled extends React.Component { - state = {} - - handleRef = node => this.setState({ node }) + contextRef = createRef() render() { - const { node } = this.state - const trigger =