From 707a286e3892156c5f8b18ba2f7c95b61c1d5916 Mon Sep 17 00:00:00 2001 From: Ridwan Sameer Date: Wed, 25 Jul 2018 18:34:20 +0530 Subject: [PATCH] Fixed yellow warning about unique key by passing key to the SVG component --- lib/BorderShadow.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/BorderShadow.js b/lib/BorderShadow.js index fe9baf8..ffa40d9 100644 --- a/lib/BorderShadow.js +++ b/lib/BorderShadow.js @@ -1,45 +1,45 @@ import React, {Component} from 'react' import {View} from 'react-native' -import Svg,{ Rect,Defs,LinearGradient,Stop,RadialGradient,Path } from 'react-native-svg' +import Svg, {Rect, Defs, LinearGradient, Stop, RadialGradient, Path} from 'react-native-svg' export default class BorderShadow extends Component { render = () => { - const { setting:{side="bottom",width=0,color="#000",border=0,opacity=1,inset=false,style={}}, children } = this.props + const {setting: {side = "bottom", width = 0, color = "#000", border = 0, opacity = 1, inset = false, style = {}}, children} = this.props const linear = (key) => { return [ - , - + , + ] } const lineWidth = border return ( - - {(()=>{ - switch (side){ + + {(() => { + switch (side) { case "top": return [ - + {linear('BorderTop')} {linear('BorderTopInset')} - + , ...children ] case "bottom": return [ ...children, - + {linear('BorderBottom')} {linear('BorderBottomInset')} - + ] default: