U
U
Username2018-07-05 12:56:57
JavaScript
Username, 2018-07-05 12:56:57

How to do without global variables in React application?

Good afternoon!
How can I, without using global variables (because any application will have access to them) , declare variables that will be available anywhere in my application?
An example - instead of such a collective farm
window.ee = new EventEmmiter();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anubis, 2018-07-05
@dalv_happy

Get some file in which Where it is needed,
import { ee } from './any-file-name';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question