Socket
Socket
Sign inDemoInstall

@bearei/react-message

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearei/react-message

Base message components that support React and React native


Version published
Maintainers
1
Created
Source

react-message

Base message components that support React and React native

Installation

yarn add @bearei/react-message --save

Parameters

NameTypeRequiredDescription
visiblebooleanMessage visible state
defaultVisiblebooleanThe default visible state for the message
durationnumberMessage display duration
contentReactNodeMessage content
typenormal success warning errorMessage type
closeIconReactNodeMessage close icon
closeIconVisiblebooleanWWhether the message close button icon is visible
onVisible(options: MessageOptions) => voidThis function is called when the message visible state changes
onClose(options: MessageOptions) => voidThis function is called when the message is closed
onClick(options: React.MouseEvent) => voidThis function is called when message is clicked
onTouchEnd(options: React.TouchEvent) => voidThis function is called when the message is pressed
onPress(options: GestureResponderEvent) => voidThis function is called when the message is pressed -- react native
renderMain(options: MessageMainProps) => voidRender the message main
renderContainer(options: MessageContainerProps) => voidRender the message container

Use

import React from 'React';
import ReactDOM from 'react-dom';
import Message from '@bearei/react-message';

const message = (
  <Message
    renderMain={({ ...props }) => <div {...props}>"message"</div>}
    renderContainer={({ id, children }) => (
      <div data-id={id} tabIndex={1}>
        {children}
      </div>
    )}
  />
);

ReactDOM.render(message, container);

Keywords

FAQs

Package last updated on 04 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc