Giter Site home page Giter Site logo

react-native-background-color's People

Contributors

dobiedad avatar lsirdevan avatar noitidart avatar pipoblak avatar ramilushev avatar soto92 avatar spidi123q avatar waitonme avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

react-native-background-color's Issues

How to import safely on ios?

At the top of my file I have:

import BackgroundColor from 'react-native-background-color';

Now this works on Android, but in iOS it is giving me error:

error: bundling failed: Error: While trying to resolve module `react-native-background-color` from file `/Users/noitidart/Documents/Did/App/AppCover/index.ios.js`, the package `/Users/noitidart/Documents/Did/node_modules/react-native-background-color/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/noitidart/Documents/Did/node_modules/react-native-background-color/index`. Indeed, none of these files exist:

  * `/Users/noitidart/Documents/Did/node_modules/react-native-background-color/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/noitidart/Documents/Did/node_modules/react-native-background-color/index/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    at ResolutionRequest.resolveDependency (/Users/noitidart/Documents/Did/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:95:15)
    at DependencyGraph.resolveDependency (/Users/noitidart/Documents/Did/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
    at Object.resolve (/Users/noitidart/Documents/Did/node_modules/metro/src/lib/transformHelpers.js:180:25)
    at dependencies.map.result (/Users/noitidart/Documents/Did/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/noitidart/Documents/Did/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
    at /Users/noitidart/Documents/Did/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
    at Generator.next (<anonymous>)
    at step (/Users/noitidart/Documents/Did/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)
    at /Users/noitidart/Documents/Did/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:467

I was hoping to avoid creating platform specific files.

build folder

According to npm this package is huge > 50 MB. Isn't the build folder included by mistake?!

kép

Application closes/crashes

I've implemented the library, it looks like a very simple implementation, however, my applications (both iOS and Android) are just closing on the BackgroundColor.setColor('#FFFFFF'); line.

There is nothing printed, no error, nothing. Any ideas why?

Is it safe to use the alpha channel in the color's hex code?

I'm using this library to get around this bug: facebook/react-native#17800. The library works well, and there doesn't seem to be a problem if I set the color to #00000000 like so:

  useEffect(() => {
    if (Platform.OS !== 'android') return;
    setTimeout(() => {
      BackgroundColor.setColor('#00000000');
    }, 0);
  }, []);

Then the flash of color behind the keyboard is hidden entirely, whereas with #FFFFFF there's a flash of white.

I'm mostly asking because I haven't seen this mentioned anywhere, so I'm concerned there might be a gotcha I don't know about. Generally, I'm not very familiar with how Android handles color values, but as far as I can tell from discussions like this it seems like #00000000 should be valid.

If this is a valid approach, I'd be happy to open a PR to document it, because I think it could be helpful to users of this library!

Not building production with 0.57.1

I upgraded to 0.57.1 - in dev mode it works fine. But when trying to build production I get the following errors:

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
bundle: Writing bundle output to: C:\Users\Mercurius\Documents\GitHub\diddo\android\app\build\generated\assets\react\release\index.android.bundle
bundle: Done writing bundle output
bundle: Copying 1 asset files
bundle: Done copying assets

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-background-color:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 47s
140 actionable tasks: 132 executed, 8 up-to-date

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.