Skip to content

docs(Visibility|Ref): deprecate components #4324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions docs/src/examples/addons/Ref/index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
import React from 'react'
import { Message } from 'semantic-ui-react'
import { Message, Icon } from 'semantic-ui-react'

import Types from './Types'

const RefExamples = () => (
<>
<Message info>
<p>
Currently, it's recommended to use <code>Ref</code> component to get
refs to HTML elements from Semantic UI React components as not all
components support native ref forwarding via{' '}
<code>React.forwardRef()</code>.
</p>
<p>
As it uses deprecated <code>ReactDOM.findDOMNode()</code> you may
receive warnings in React's StrictMode. We are working on it in{' '}
<a href='https://github.com/Semantic-Org/Semantic-UI-React/issues/3819'>
Semantic-Org/Semantic-UI-React#3819
</a>
.
</p>
<Message icon warning>
<Icon name='warning sign' />

<Message.Content>
<Message.Header>Deprecation notice</Message.Header>
<p>
<code>Ref</code> component is deprecated and will be removed in the
next major release. Please follow our{' '}
<a href='https://github.com/Semantic-Org/Semantic-UI-React/pull/4324'>
upgrade guide
</a>{' '}
to avoid breaks during upgrade to v3.
</p>
<p>
It's still recommended to use <code>Ref</code> component with v2 to
get refs to HTML elements from Semantic UI React components, but as it
uses deprecated <code>ReactDOM.findDOMNode()</code> you may receive
warnings in React's StrictMode. We are working on it in{' '}
<a href='https://github.com/Semantic-Org/Semantic-UI-React/issues/3819'>
Semantic-Org/Semantic-UI-React#3819
</a>
.
</p>
</Message.Content>
</Message>

<Types />
</>
)
Expand Down
21 changes: 19 additions & 2 deletions docs/src/examples/behaviors/Visibility/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
import React from 'react'
import { Message, Icon } from 'semantic-ui-react'

import Types from './Types'
import Settings from './Settings'

const VisibilityExamples = () => (
<div>
<>
<Message icon warning>
<Icon name='warning sign' />

<Message.Content>
<Message.Header>Deprecation notice</Message.Header>
<p>
<code>Visibility</code> component is deprecated and will be removed in
the next major release. Please follow our{' '}
<a href='https://github.com/Semantic-Org/Semantic-UI-React/pull/4324'>
upgrade guide
</a>{' '}
to avoid breaks during upgrade to v3.
</p>
</Message.Content>
</Message>

<Types />
<Settings />
</div>
</>
)

export default VisibilityExamples
2 changes: 2 additions & 0 deletions src/behaviors/Visibility/Visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {

/**
* Visibility provides a set of callbacks for when a content appears in the viewport.
*
* @deprecated This component is deprecated and will be removed in next major release.
*/
export default class Visibility extends Component {
calculations = {
Expand Down
2 changes: 1 addition & 1 deletion static.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default async () => {
exampleSources,
sidebarSections,
displayName: 'Ref',
deprecated: false,
deprecated: true,
seeTags: [],
}
},
Expand Down