Javascript

Deep routing in ReactJS app

Direct access to a deep routing in a ReactJS app whiout get the 404 not found page.

.htaccess file

Redirect all the http direct call to the index file.

RewriteEngine On  
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

RewriteRule ^ /index.html [L]

Scroll the page to element

Scroll the web window to a especific element of the dom document in a Javascript action. The code will refer the element by his id and push a margin to take better position. [ read ]