Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is domDependencyConfig.json #90

Open
mrtry opened this issue Oct 27, 2018 · 5 comments
Open

What is domDependencyConfig.json #90

mrtry opened this issue Oct 27, 2018 · 5 comments

Comments

@mrtry
Copy link

mrtry commented Oct 27, 2018

I want to use react-native-vector-icon.
Tried install, Got the following error.

What is domDependencyConfig.json ...?

$ yarn add react-native-vector
$ react-native link react-native-vector-icons
rnpm-install ERR! ERRPACKAGEJSON No package found. Are you sure this is a React Native project?

Could not find domDependencyConfig.json in your project, please add it.

Error: Could not find domDependencyConfig.json in your project, please add it.
    at findDependencyConfigPath (/Users/symmt/Program/Study/ReactNative/ReactNativeDomIntoReactNativePaper/node_modules/react-native-dom/local-cli/core/dom/findDepConfigPath.js:22:11)
    at Object.projectConfigDom [as projectConfig] (/Users/symmt/Program/Study/ReactNative/ReactNativeDomIntoReactNativePaper/node_modules/react-native-dom/local-cli/core/dom/index.js:9:33)
    at Object.keys.forEach.key (/Users/symmt/Program/Study/ReactNative/ReactNativeDomIntoReactNativePaper/node_modules/react-native/local-cli/core/index.js:100:36)
    at Array.forEach (<anonymous>)
    at Object.getProjectConfig (/Users/symmt/Program/Study/ReactNative/ReactNativeDomIntoReactNativePaper/node_modules/react-native/local-cli/core/index.js:99:28)
    at Object.link [as func] (/Users/symmt/Program/Study/ReactNative/ReactNativeDomIntoReactNativePaper/node_modules/react-native/local-cli/link/link.js:121:22)
    at Promise.resolve.then (/Users/symmt/Program/Study/ReactNative/ReactNativeDomIntoReactNativePaper/node_modules/react-native/local-cli/cliEntry.js:117:22)
    at <anonymous>
@mrtry mrtry changed the title How to install react-native-vector-icon What is domDependencyConfig.json Nov 10, 2018
@anhdle14
Copy link

Experienced this too, are there any hacks or solutions yet?

@iamralpht
Copy link
Contributor

I did touch domDependencyConfig.json and the error went away. YMMV.

@anhdle14
Copy link

That really not fix the issue, because react-native-dom still depends on native-module to be ported to the web.
For the future, we need to somehow do:

  1. react-native link to generate dependencies for the web.
  2. react-native-web to somehow take react-native link to use the web-version instead of native module.

@iamralpht
Copy link
Contributor

Isn't the list of "native modules" in dom/bootstrap.js equivalent to what react-native link does for the iOS and Android build systems?

@anhdle14
Copy link

anhdle14 commented Nov 20, 2018

Haven't got the chance to look into the issue but in short: yes

import { RNDomInstance } from "react-native-dom";
import { name as appName } from "../app.json";

// Path to RN Bundle Entrypoint ================================================
const rnBundlePath = "./entry.bundle?platform=dom&dev=true";

// React Native DOM Runtime Options =============================================
const ReactNativeDomOptions = {
  enableHotReload: false,
  nativeModules: []
};

// App Initialization ============================================================
const app = new RNDomInstance(
  rnBundlePath,
  appName,
  document.body,
  ReactNativeDomOptions
);

app.start();

Haven't try to do index.dom.js to see if we can use react-native-web to do the render with non native modules, and let react-native handle gesture, yoga (flex). That would be a most optimal way for now. I could be wrong, but it is good to try it nonetheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants