diff --git a/README.md b/README.md index fd513fdc..29a43347 100644 --- a/README.md +++ b/README.md @@ -70,15 +70,15 @@ # NOTICE: -Due to breaking changes in react-native, the version given in the left column +Due to breaking changes in react-native, the version given in the left column (and higher versions) of react-native-svg only supports the react-native version in the right column (and higher versions, if possible). -It is recommended to use the version of react given in the peer dependencies +It is recommended to use the version of react given in the peer dependencies of the react-native version you are using. The latest version of react-native-svg should always work in a clean react-native project. - + | react-native-svg | react-native | |------------------|--------------| | 3.2.0 | 0.29 | @@ -181,7 +181,7 @@ react-native link ``` Make a reproduction of the problem in `App.js` - + ```bash react-native run-ios react-native run-android @@ -395,6 +395,33 @@ originY | 0 | Transform originY coordinates for the current obj ``` +Colors set in the Svg element are inherited by its children: + +```html + + + + +``` + +![Pencil](https://raw.githubusercontent.com/react-native-community/react-native-svg/master/screenShoots/pencil.png) + + Code explanation: + + * The fill prop defines the color inside the object. + * The stroke prop defines the color of the line drawn around the object. + * The color prop is a bit special in the sense that it won't color anything by itself, but define a kind of color variable that can be used by children elements. In this example we're defining a "green" color in the Svg element and using it in the second Path element via stroke="currentColor". The "currentColor" is what refers to that "green" value, and it can be used in other props that accept colors too, e.g. fill="currentColor". + ### Rect The element is used to create a rectangle and variations of a rectangle shape: diff --git a/screenShoots/pencil.png b/screenShoots/pencil.png new file mode 100644 index 00000000..7730a1b5 Binary files /dev/null and b/screenShoots/pencil.png differ