5

As I know about it, This checks and gives warnings for React-Native code and its lifecycles.

I read about it from What is StrictMode in react?

How can I use it in react native ?

Shashank Malviya
  • 670
  • 6
  • 17

1 Answers1

4

Here is a simple example to use StrictMode in React Native StrictMode can be directly imported from React and can used like wrapping up View inside it.

import React, {Component, StrictMode} from 'react';
import {View} from 'react-native';

class Example extends Component {
 render() {
  return (
   <StrictMode>
    <View />
   </StrictMode>
  );
 }
} 

export default Example;
Shashank Malviya
  • 670
  • 6
  • 17
Yoel
  • 7,555
  • 6
  • 27
  • 59
  • 6
    Code-only answers are generally frowned upon on this site. Could you please edit your answer to include some comments or explanation of your code? Explanations should answer questions like: What does it do? How does it do it? Where does it go? How does it solve OP's problem? See: [How to anwser](https://stackoverflow.com/help/how-to-answer). Thanks! – Eduardo Baitello Nov 20 '19 at 13:23