Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dol-design/rn

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dol-design/rn

  • 0.1.11
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

快速开始

Dolphin提供了兼容了三端的可配置组件库

安装

目前有两种安装方式

npm

npm i @dol-design/rn --save

yarn

yarn add @dol-design/rn

使用

全量引入

import { Button } from '@dol-design/rn';

按需引入

手动引入
import Button from '@dol-design/rn/lib/button';
使用 babel-plugin-import (推荐)

但大多数人更习惯的写法如下:

import { Button } from '@dol-design/rn';

通过 babel-plugin-import 插件,可以将上述代码转化为类似下面的代码:

import Button from '@dol-design/rn/lib/button';

babel配置:

{
  plugins: [
    ['import', {
      libraryName: '@dol-design/rn',
    }]
  ]
}

Web侧使用

我们在web上使用了 react-native-web 这个库,所以需要针对webpack做下额外的配置

{
alias: {
      'react-native$': 'react-native-web',
      'react-native-svg': 'react-native-svg-web',
      'react-native-linear-gradient': 'react-native-web-linear-gradient'
    },
}

FAQs

Package last updated on 29 Apr 2021

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