
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
react-share-selected-text
Advanced tools
npm install react-share-selected-text
yarn add react-share-selected-text
import SharedSelectText from 'react-share-selected-text';
import 'react-share-selected-text/lib/index.min.css';
const App = () => (
<SharedSelectText buttons={[ icon:'wechat' ]}>
here is some article texts
</SharedSelectText>
);
ShareSelectedProps:属性如下
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| timeout | 浮动框出现的延迟时间 | number | 300 |
| buttons | 设置浮动框上面的按钮 | IButtons[] | |
| buttonsRender | 浮动框自定义渲染,优先级低于 buttons | JSX.Element | |
| gridSize | 按钮格子的大小 | number | 30 |
| buttonsClassName | 按钮区域自定义 class | string | |
| onShow | 当组件可见时的钩子函数 | Function | |
| onHide | 当组件不可见时的钩子函数 | Function |
ButtonProps 属性如下:
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| icon | 展示图标,内置有wechat,twitter,facebook,weibo | string | JSX.Element |
| onClick | 图标点击事件 | Function |
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.