MCPcopy Create free account
hub / github.com/ReactTraining/react-media / componentDidMount

Method componentDidMount

modules/Media.js:134–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132 }
133
134 componentDidMount() {
135 this.initialize();
136 // If props.defaultMatches has been set, ensure we trigger a two-pass render.
137 // This is useful for SSR with mismatching defaultMatches vs actual matches from window.matchMedia
138 // Details: https://github.com/ReactTraining/react-media/issues/81
139 if (this.props.defaultMatches !== undefined) {
140 this.updateMatches();
141 }
142 }
143
144 onChange() {
145 const { onChange } = this.props;

Callers

nothing calls this directly

Calls 1

initializeMethod · 0.95

Tested by

no test coverage detected