Giter Site home page Giter Site logo

Comments (4)

aminsaedi avatar aminsaedi commented on June 2, 2024 1

Thanks :))
helped me a lot

from react-navigation-collapsible.

benevbright avatar benevbright commented on June 2, 2024

hi @aminsaedi It doesn't change according to the change from your state?

from react-navigation-collapsible.

aminsaedi avatar aminsaedi commented on June 2, 2024

No its remain the initial value of the state after changing that.

I put there lines of code in my screen

` const options = {
navigationOptions: {
/* Add a custom header to 'useCollapsibleHeader' options the same way you would add it to the Stack.Screen options */
header: ({ scene, previous, navigation }) => {
const { options } = scene.descriptor;
const title =
options.headerTitle !== undefined
? options.headerTitle
: options.title !== undefined
? options.title
: scene.route.name;

    return (
      <View
        style={{
          width: "100%",
          height: 200,
          backgroundColor: "blue",
          padding: 20,
        }}
      >
        <View
          style={{
            flex: 1,
            backgroundColor: "gray",
            alignItems: "center",
            justifyContent: "center",
          }}
        >
          <Text
            style={{
              fontSize: 32,
              color: "white",
              marginBottom: 10,
            }}
          >
            {activeSortMethod.name}
          </Text>

          {previous && (
            <TouchableOpacity onPress={() => setShowSortByModal(true)}>
              <View>
                <Text
                  style={{
                    fontSize: 16,
                    fontWeight: "bold",
                    color: "white",
                  }}
                >{"<< GO BACK"}</Text>
              </View>
            </TouchableOpacity>
          )}
        </View>
      </View>
    );
  },
},

};
const {
onScroll /* Event handler /,
containerPaddingTop /
number /,
scrollIndicatorInsetTop /
number */,
} = useCollapsibleHeader(options);
`

I'm sure that i chage state correctly.but it's not seems to work

from react-navigation-collapsible.

benevbright avatar benevbright commented on June 2, 2024

You can use navigation.setParams({ myTitle: 'aaaaa' }); and render scene.route.params.myTitle.
This will re-render your new param.

from react-navigation-collapsible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.