Coder Social home page Coder Social logo

dotmind / rn-shadow-generator Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 1.0 2.3 MB

React Native Shadow Generator is a tool to quickly generate your shadow's Components. Tool builded by .mind team.

License: MIT License

JavaScript 2.74% TypeScript 97.26%
android ios react react-native rn-shadow-generator shadow

rn-shadow-generator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fredikey

rn-shadow-generator's Issues

[SOLVED] "Jest encountered an unexpected token" when importing `ShadowView`

Facing an issue using the library with a non-TS project and testing with Jest caused me an issue with this library: Jest encountered an unexpected token. This happened when importing the ShadowView component

import { ShadowView } from "@dotmind/rn-shadow-generator"

If the maintainers consider this valid, it could be evolved to a specific session inside the documentation.

Why it happens

It is just a supposition but as this library is probably shipped without pre-compiling into "native" JS, it still has some references to new JS or even TS.

How to solve

Jest allows a config file (jest.config.js) that it is possible to pass your own configs. By default, Jest doesn't transform or change anything from node_modules/ dir. It is possible to change that and pass that with the option transformIgnorePatterns into the jest.config.js file:

module.exports = {
  // ...
  transformIgnorePatterns: [
     "node_modules/(?!@dotmind)"
  ],
  // ...
};

Those options allow a list of Regular Expressions passed as Strings and that's why the ?! should be placed at start of the desired string to be ignored. If it is needed to add another library to be ignored such as react-navigation it is possible (and recommended) to inform as a string: "node_modules/(?!@dotmind|@react-navigation)"

Hope that helps someone else! ๐Ÿ˜„

Some references

shadowColor is not working

Hi, thanks for your work!
I applied color to shadowColor property, and nothing changes. 'red', '#2C66F5', 'rgba(0, 0, 0, 0.1)' - no matter what I tried, nothing worked.
Tested on Android 8, RN 0.64.1, latest library version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.