Merge two react projects with different Routers into one? - react-router

I am new to react. My usecase is like this :
I want to merge two react project(i.e. 1st and 2nd) one having hashrouter and the other having browserrouter .
What i had did ?
I tried to convert 1st App.js into a component(i.e.App1.js) and kept it in Routes.js file of 2nd project with path like this <Route exact path='/App1' component={App1}/> . It seems it is routing the page but the functionality of the 1st App.js file is not working.
I know what i explained top wouldn't be little difficult to understand . Apologizes for that.
What i want to know ?
Is it possible to keep different routers in the one project or Do i need to have only one router in the a project ?
Any help is appreciated ?
Thanks

Related

React typescript barrel export not working after renaming file

I had 2 component files, one was Navigation.tsx and other one was NavigationList.tsx. I merged that components into one and renamed NavigationList.tsx into Navigation.tsx and deleted origial Navigation.tsx (also renamed NavigationList function into Navigation) and got error on server start:
export 'Navigation' (imported as 'Navigation') was not found in 'modules'
I found solution that worked for some guy here on stack to restart computer and clear cache but didn't work for me. When I make default export it works, but I don't want defalut export neither full path import in another component. Any1 have any suggestion for another solution?
Also my project structure looks like this:
--/src
---/modules
----/index.ts
----/header
----/index.ts
-----/components
------/Navigation.tsx
------/index.ts
---/views
----/header
-----/Header.tsx <= importing Navigation into Header.tsx
If anyone have problems like this, and neither solution works for you, just delete node_modules and install again, that fixed my problem.

Is there a way to route to multiple files in my views in Ruby on Rails

I am making a website dedicated to flash and unity games to learn Ruby on Rails hands on and I wanted to know if there was a way to route to all the documents in a folder without entering them in the routes file one by one. I am not sure if I am just being blind, but I have been looking everywhere for an answer.
For example i have to enter:
Get 'game1', to: "games#game1"
In the routes file for an individual game, but I want to be able to add a entire library without having to enter them in one by one.
correct me if i'm wrong, but you have several files (games) into the games view folder and you want to route through a single action?
so, basically, in your routes.rb would have:
get "games/:game_number" => "games#show"
and then, on your games_controller.rb
def show
# ...
render "games/#{params[:game_number]}"
end
so, in this case, if you hit /games/first, it would render the view games/first.html.erb
this is not a good practice since the are several pitfalls through out, but, having that in mind, this should work if i got the right scenario :)
This is what variable segments are for. You should be using something like
get "games/:id" => "games#show"
and looking up the game by params[:id].

Multi route graphhoper project

Have a nice day.
I'm creating a project using graphopper and
I want to route all routes for not one, but
several routes from point A to B. How do I do this?
I have tried:
EdgeIteratorState edge = path.calcEdges().get(0);
edge.setDistance(100000);
But the next time you created route, it does not change.
Can you please tell how to make multiple routes?

How to import a widget in alloy titanium

Newbie question here:
I'm fiddling around with titanium studio with alloy mvc and starting to get the hang of it. It's just not clear to me how I can import a widget into my project.
I found a nice slider menu and want to use this in my own project.
Now the docs say you have to add a dependency in the config.json like so:
"dependencies": {
"com.slider" : "1.0"
}
and then you'd be able to use it in your view:
<Widget src="com.slider"></Widget>
But don't I need to import it into my project first? And if so, how? Importing it as a project only adds it to my workspace, not in my project user /widgets/slider
Upon building this I also get the following error:
config.json references non-existent widgets: ["com.slider"]
I've been looking for hours already on google but there's not much info on this besides the alloy docs that don't cover the importing thing.
Help?
Allright, so first thing you need to do is IMPORT the widget into your project.
If you take a look at the structure of an alloy project you should see in the app folder another folder called "widgets". Copy and Paste the widget inside of it, something like this (the folder name is different because I use another slider):
Then in your view (let's say you have a main view for the slider with a window in it):
<Window id="mainWindow" class="container">
<Require type="widget" src="com.slider" id="ds"/>
</Window>
Finally, in your config.json:
"dependencies": {
"com.slider":"1.0"
}
}
gitt.io is also great for finding and installing titanium widgets and modules
CLI installation: http://gitt.io/cli

Problems while trying to use components from another module in intellij idea AS3

i'am trying to use components from another module, but is not working.
Look what i have:
I have my project, its an app to convert files, and its working everything is ok. Now i want to change the interface... for that i cloned a github repository thats is a project with the components that i want to use, and imported it as a module. (should i import as a module or as a project?)
Everything great till now, but when i try to use the components from the module i cant find the classes or even the module...
Any suggestions?
You should add your imported sources as a new module (let's call it B), then you should add a dependency from your original module A to your module B in order to use its code.
See this page on how to configure module dependencies.